Initial version (#1)
Co-authored-by: Julien Valverdé <julien.valverde@mailo.com> Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
17
packages/server/src/entrypoint.bun.ts
Normal file
17
packages/server/src/entrypoint.bun.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { BunContext, BunHttpServer, BunRuntime } from "@effect/platform-bun"
|
||||
import { Effect, Layer } from "effect"
|
||||
import { ServerConfig } from "./config"
|
||||
import { Server } from "./server"
|
||||
|
||||
|
||||
Layer.launch(Server).pipe(
|
||||
Effect.provide(Layer.empty.pipe(
|
||||
Layer.provideMerge(ServerConfig.httpPort.pipe(
|
||||
Effect.map(port => BunHttpServer.layer({ port })),
|
||||
Layer.unwrapEffect,
|
||||
)),
|
||||
Layer.provideMerge(BunContext.layer),
|
||||
)),
|
||||
|
||||
BunRuntime.runMain,
|
||||
)
|
||||
Reference in New Issue
Block a user