This commit is contained in:
Julien Valverdé
2025-09-12 00:26:32 +02:00
parent 908e7d712c
commit c0df42c9a9
7 changed files with 53 additions and 2 deletions

View File

@@ -0,0 +1,23 @@
import { Effect, flow, Layer, Match } from "effect"
import { ServerConfig } from "./config"
import { HttpAppLive } from "./http"
const ServerDevelopment = Layer.empty.pipe(
Layer.provideMerge(HttpAppLive),
)
const ServerProduction = Layer.empty.pipe(
Layer.provideMerge(HttpAppLive),
)
export const Server = ServerConfig.mode.pipe(
Effect.map(flow(
Match.value,
Match.when("development", () => ServerDevelopment),
Match.when("production", () => ServerProduction),
Match.exhaustive,
)),
Layer.unwrapEffect,
)