diff --git a/packages/server/src/config.ts b/packages/server/src/config.ts index e797ac9..da44c81 100644 --- a/packages/server/src/config.ts +++ b/packages/server/src/config.ts @@ -1,6 +1,18 @@ +import { Schema as S } from "@effect/schema" import { Config } from "effect" +export const mode = Config.string("NODE_ENV").pipe( + Config.withDefault("development"), + Config.validate({ + message: "Expected 'development' or 'production'", + validation: S.is(S.Union( + S.Literal("development"), + S.Literal("production"), + )), + }) +) + export const httpPort = Config.number("HTTP_PORT").pipe(Config.withDefault(8080)) export const rpcHTTPRoot = Config.string("RPC_HTTP_ROOT").pipe(Config.withDefault("/rpc")) export const rpcHTTPPlaygroundRoot = Config.string("RPC_HTTP_PLAYGROUND_ROOT").pipe(Config.withDefault("/rpc/playground"))