const RpcLayer = RpcServer.layer(Rpcs).pipe(Layer.provide(RpcsLive));
// Choose the protocol and serialization format
const HttpProtocol = RpcServer.layerProtocolHttp({
path: "/rpc",
}).pipe(Layer.provide(RpcSerialization.layerNdjson));
// // Create the main server layer
const Main = HttpRouter.Default.serve().pipe(
Layer.provide(RpcLayer),
Layer.provideMerge(PrismaLayer),
Layer.provide(HttpProtocol),
Layer.provide(
NodeHttpServer.layer(createServer, {
port: process.env.SERVER_PORT ? Number(process.env.SERVER_PORT) : 3001,
}),
),
Layer.provideMerge(NodeObservability),
);
NodeRuntime.runMain(Layer.launch(Main));
const RpcLayer = RpcServer.layer(Rpcs).pipe(Layer.provide(RpcsLive));
// Choose the protocol and serialization format
const HttpProtocol = RpcServer.layerProtocolHttp({
path: "/rpc",
}).pipe(Layer.provide(RpcSerialization.layerNdjson));
// // Create the main server layer
const Main = HttpRouter.Default.serve().pipe(
Layer.provide(RpcLayer),
Layer.provideMerge(PrismaLayer),
Layer.provide(HttpProtocol),
Layer.provide(
NodeHttpServer.layer(createServer, {
port: process.env.SERVER_PORT ? Number(process.env.SERVER_PORT) : 3001,
}),
),
Layer.provideMerge(NodeObservability),
);
NodeRuntime.runMain(Layer.launch(Main));