This commit is contained in:
张成
2026-03-18 15:46:57 +08:00
parent 37e39d35b8
commit 3d3b9b5dfa
12 changed files with 175 additions and 63 deletions

View File

@@ -1,4 +1,4 @@
import dotenv from 'dotenv';
import { get_app_config } from './config/app_config.js';
import Koa from 'koa';
import body_parser from 'koa-bodyparser';
@@ -6,8 +6,6 @@ import { sequelize } from './models/index.js';
import { crawl_router } from './routes/crawl.js';
import { start_all_cron_tasks } from './services/schedule_loader.js';
dotenv.config();
const app = new Koa();
app.use(body_parser({ jsonLimit: '10mb' }));
@@ -18,7 +16,8 @@ app.use(async (ctx) => {
ctx.body = { ok: false, error: 'not_found' };
});
const port = Number(process.env.SERVER_PORT || 38080);
const cfg = get_app_config();
const port = cfg.server.port;
await sequelize.authenticate();
await sequelize.sync();