mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
初始化api
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
import 'reflect-metadata'; // We need this in order to use @Decorators
|
||||
|
||||
import config from './config';
|
||||
|
||||
import express from 'express';
|
||||
|
||||
import Logger from './loaders/logger';
|
||||
|
||||
async function startServer() {
|
||||
const app = express();
|
||||
|
||||
await require('./loaders').default({ expressApp: app });
|
||||
|
||||
app
|
||||
.listen(config.port, () => {
|
||||
Logger.info(`
|
||||
################################################
|
||||
🛡️ Server listening on port: ${config.port} 🛡️
|
||||
################################################
|
||||
`);
|
||||
})
|
||||
.on('error', (err) => {
|
||||
Logger.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
|
||||
startServer();
|
||||
Reference in New Issue
Block a user