2021-07-02 22:55:14 +08:00
|
|
|
import 'module-alias/register';
|
|
|
|
|
2021-06-26 01:39:02 +08:00
|
|
|
import dotenv from 'dotenv';
|
|
|
|
dotenv.config();
|
|
|
|
|
2021-06-06 18:30:37 +08:00
|
|
|
import Koa from 'koa';
|
2021-06-27 20:44:05 +08:00
|
|
|
import initApp from './init';
|
2021-07-03 21:19:20 +08:00
|
|
|
import { getEnv } from './utils/env';
|
2021-06-06 18:30:37 +08:00
|
|
|
|
|
|
|
const app = new Koa();
|
2021-06-28 21:58:15 +08:00
|
|
|
const port = Number(getEnv('PORT', '3001'));
|
2021-06-06 18:30:37 +08:00
|
|
|
|
2021-06-27 20:44:05 +08:00
|
|
|
(async () => {
|
|
|
|
try {
|
|
|
|
await initApp(app, port);
|
|
|
|
} catch (error: unknown) {
|
|
|
|
console.log('Error while initializing app', error);
|
|
|
|
}
|
|
|
|
})();
|