22
src/app.ts
22
src/app.ts
@@ -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()
|
||||
Reference in New Issue
Block a user