refactor: encapsulate server startup in static method

main
borja (aider) 3 months ago
parent a4f0b9b832
commit 352d201db5

@ -71,7 +71,13 @@ export class WebhookServer {
}
}
Bun.serve({
static start() {
if (process.env.NODE_ENV !== 'test') {
const server = Bun.serve({
port: PORT,
fetch: WebhookServer.handleRequest,
});
console.log(`Server running on port ${PORT}`);
return server;
}
}

Loading…
Cancel
Save