feat: Make backend port configurable via PORT environment variable (defaults to 3001)
This allows changing the port without editing code:
This commit is contained in:
@@ -679,12 +679,13 @@ const app = new Elysia()
|
||||
} catch {
|
||||
return new Response('Frontend not built. Run `bun run build`', { status: 503 });
|
||||
}
|
||||
})
|
||||
|
||||
// Start server
|
||||
.listen(3001);
|
||||
|
||||
logger.info(`Backend server running`, { port: app.server?.port, url: `http://localhost:${app.server?.port}` });
|
||||
logger.info(`API endpoints available`, { url: `http://localhost:${app.server?.port}/api` });
|
||||
|
||||
// Start server - uses PORT environment variable if set, otherwise defaults to 3001
|
||||
const PORT = process.env.PORT || 3001;
|
||||
|
||||
.listen(PORT);
|
||||
|
||||
export default app;
|
||||
|
||||
Reference in New Issue
Block a user