const main = Effect.gen(function* () {
...
// Start Bun server
const server = yield* Effect.sync(() => Bun.serve({
fetch: yoga.fetch,
port: 4000
}))
// Keep the Effect running indefinitely while the server is active
yield* Effect.never
})
Effect.runPromiseExit(main).then(console.log)
const main = Effect.gen(function* () {
...
// Start Bun server
const server = yield* Effect.sync(() => Bun.serve({
fetch: yoga.fetch,
port: 4000
}))
// Keep the Effect running indefinitely while the server is active
yield* Effect.never
})
Effect.runPromiseExit(main).then(console.log)