16 lines
452 B
TypeScript
16 lines
452 B
TypeScript
import { serve } from '@hono/node-server';
|
|
import dotenv from 'dotenv';
|
|
import { createApp } from './app.js';
|
|
import { startBackgroundServices } from './bootstrap.js';
|
|
|
|
dotenv.config();
|
|
|
|
const app = createApp();
|
|
const port = Number(process.env.SERVER_PORT) || 3001;
|
|
|
|
console.log(`Server starting on port ${port}...`);
|
|
startBackgroundServices();
|
|
serve({ fetch: app.fetch, port }, () => {
|
|
console.log(`Server running at http://localhost:${port}`);
|
|
});
|