初始化api

This commit is contained in:
whyour
2021-03-15 21:09:30 +08:00
parent f1f8ece8a2
commit 99a8dc78db
28 changed files with 664 additions and 49 deletions
+28
View File
@@ -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();