RPCWebSocketServer

This commit is contained in:
Julien Valverdé
2024-07-09 02:15:18 +02:00
parent 3ac12bfe3e
commit c25c525d6f
8 changed files with 55 additions and 24 deletions

View File

@@ -1,8 +1,8 @@
import { Effect, Layer } from "effect"
import { expressHandler } from "trpc-playground/handlers/express"
import { rpcHTTPPlaygroundRoot, rpcHTTPRoot } from "../config"
import { ExpressApp } from "../express/ExpressApp"
import { RPCRouter } from "./RPCRouter"
import { rpcPlaygroundRoot, rpcRoot } from "./config"
export module RPCPlaygroundRoute {
@@ -10,10 +10,10 @@ export module RPCPlaygroundRoute {
export const Dev = Layer.effectDiscard(Effect.gen(function*() {
const app = yield* ExpressApp
const playgroundEndpoint = yield* rpcPlaygroundRoot
const playgroundEndpoint = yield* rpcHTTPPlaygroundRoot
const handler = expressHandler({
trpcApiEndpoint: yield* rpcRoot,
trpcApiEndpoint: yield* rpcHTTPRoot,
playgroundEndpoint,
router: yield* RPCRouter,
})