Files
classroomio/apps/api/src/index.ts
T

23 lines
484 B
TypeScript
Raw Normal View History

import 'dotenv/config';
2025-01-18 11:13:05 +01:00
import { app } from '$src/app';
import { configureOpenAPI } from '$src/utils/openapi';
import { env } from '$src/config/env';
import { serve } from '@hono/node-server';
import { showRoutes } from 'hono/dev';
2025-01-18 11:13:05 +01:00
// Start server
const port = env.PORT ? parseInt(env.PORT) : 3002;
2025-01-18 11:13:05 +01:00
function startServer() {
console.log('Starting server...');
serve({ fetch: app.fetch, port });
showRoutes(app, { colorize: true });
}
configureOpenAPI(app);
startServer();