Context adapter work
This commit is contained in:
@@ -3,7 +3,6 @@ import { Effect, Layer } from "effect"
|
||||
import { rpcHTTPRoot } from "../config"
|
||||
import { ExpressApp } from "../http/ExpressApp"
|
||||
import { TRPCContextCreator } from "../trpc/TRPCContextCreator"
|
||||
import { contextCreatorExpressAdapter } from "../trpc/adapters"
|
||||
import { RPCRouter } from "./RPCRouter"
|
||||
|
||||
|
||||
@@ -14,7 +13,7 @@ export module RPCRoute {
|
||||
app.use(yield* rpcHTTPRoot,
|
||||
createExpressMiddleware({
|
||||
router: yield* RPCRouter,
|
||||
createContext: contextCreatorExpressAdapter(yield* TRPCContextCreator),
|
||||
createContext: (yield* TRPCContextCreator).createExpressContext,
|
||||
}),
|
||||
)
|
||||
}))
|
||||
|
||||
@@ -2,7 +2,6 @@ import { applyWSSHandler } from "@trpc/server/adapters/ws"
|
||||
import { Effect, Layer } from "effect"
|
||||
import { WebSocketServer } from "../http/WebSocketServer"
|
||||
import { TRPCContextCreator } from "../trpc/TRPCContextCreator"
|
||||
import { contextCreatorWSSAdapter } from "../trpc/adapters"
|
||||
import { RPCRouter } from "./RPCRouter"
|
||||
|
||||
|
||||
@@ -12,7 +11,7 @@ export module RPCWebSocketHandler {
|
||||
return applyWSSHandler({
|
||||
wss: yield* WebSocketServer,
|
||||
router: yield* RPCRouter,
|
||||
createContext: contextCreatorWSSAdapter(yield* TRPCContextCreator),
|
||||
createContext: (yield* TRPCContextCreator).createWebSocketContext,
|
||||
})
|
||||
}),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user