Implemented more loaders

ref #4
This commit is contained in:
2020-11-25 18:31:06 +01:00
parent e3883fecbd
commit 6ce88a1e3d
5 changed files with 44 additions and 25 deletions

View File

@@ -7,21 +7,17 @@ import bodyparser from "body-parser";
import 'reflect-metadata';
import routerMain from './routes/index';
// const loaders = require('./loaders');
import * as loaders from './loaders/index';
import loaders from './loaders/index';
dotenvSafe.config();
const app = express();
let app = express();
const PORT = process.env.APP_PORT || 4010;
createConnection()
.then((connection) => {})
.catch((err) => {
consola.error(err);
})
.finally(() => {
// await loaders.init(app);
app.use('/api/', routerMain);
app.listen(PORT, () => {
consola.success(`⚡️[server]: Server is running at http://localhost:${PORT}`);
});
async function main() {
await loaders(app);
app.listen(PORT, () => {
consola.success(`⚡️[server]: Server is running at http://localhost:${PORT}`);
});
}
main()