import { serve } from '@hono/node-server'; import { createApp } from './app.js'; import { startBackgroundServices } from './bootstrap.js'; import { assertRuntimeConfig, serverConfig } from './config.js'; // 配置错误在启动期暴露,而不是等到第一次请求才 500。 assertRuntimeConfig(); const app = createApp(); console.log(`Server starting on port ${serverConfig.port}...`); startBackgroundServices(); serve({ fetch: app.fetch, port: serverConfig.port }, () => { console.log(`Server running at http://localhost:${serverConfig.port}`); });