1
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user