const V1Test = HttpApiBuilder.group(MyApi, "v1", (handlers) =>
handlers.handle("generate", (a) => Effect.succeed("this is a test!")).handle("health", () => Effect.succeed("OK"))
);
const V1Live = HttpApiBuilder.group(MyApi, "v1", (handlers) =>
handlers
.handle("generate", (a) => Effect.succeed("production response"))
.handle("health", () => Effect.succeed("OK"))
);
const MyApiLive = HttpApiBuilder.api(MyApi).pipe(Layer.provide(V1Live));
const ServerLive = HttpApiBuilder.serve().pipe(
Layer.provide(MyApiLive),
Layer.provide(NodeHttpServer.layer(createServer, { port: 3000 }))
);
Layer.launch(ServerLive).pipe(NodeRuntime.runMain);
const V1Test = HttpApiBuilder.group(MyApi, "v1", (handlers) =>
handlers.handle("generate", (a) => Effect.succeed("this is a test!")).handle("health", () => Effect.succeed("OK"))
);
const V1Live = HttpApiBuilder.group(MyApi, "v1", (handlers) =>
handlers
.handle("generate", (a) => Effect.succeed("production response"))
.handle("health", () => Effect.succeed("OK"))
);
const MyApiLive = HttpApiBuilder.api(MyApi).pipe(Layer.provide(V1Live));
const ServerLive = HttpApiBuilder.serve().pipe(
Layer.provide(MyApiLive),
Layer.provide(NodeHttpServer.layer(createServer, { port: 3000 }))
);
Layer.launch(ServerLive).pipe(NodeRuntime.runMain);