Files
website/packages/server/src/server.ts
Julien Valverdé c0df42c9a9 Work
2025-09-12 00:26:32 +02:00

24 lines
565 B
TypeScript

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,
)