Config refactoring
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { createExpressMiddleware } from "@trpc/server/adapters/express"
|
||||
import { Effect, Layer } from "effect"
|
||||
import { rpcHTTPRoot } from "../config"
|
||||
import { ServerConfig } from "../ServerConfig"
|
||||
import { ExpressApp } from "../http/ExpressApp"
|
||||
import { TRPCContextCreator } from "../trpc/TRPCContextCreator"
|
||||
import { RPCRouter } from "./RPCRouter"
|
||||
@@ -10,7 +10,7 @@ export module RPCRoute {
|
||||
export const Live = Layer.effectDiscard(Effect.gen(function*() {
|
||||
const app = yield* ExpressApp
|
||||
|
||||
app.use(yield* rpcHTTPRoot,
|
||||
app.use(yield* ServerConfig.rpcHTTPRoot,
|
||||
createExpressMiddleware({
|
||||
router: yield* RPCRouter,
|
||||
createContext: (yield* TRPCContextCreator).createExpressContext,
|
||||
|
||||
Reference in New Issue
Block a user