Files
pronature-platform/backend/main.js
T
2024-10-29 19:49:24 +02:00

31 lines
728 B
JavaScript

import 'dotenv/config';
console.debug = function(){
if (process.env.debug){
console.log.apply(console, arguments);
}
}
import App from './app/App.js';
const modules = [
{name:'Config', path:'app/Config.js'},
{name:'Db', path:'app/Db.js'},
{name:'WebServer', path:'app/WebServer.js'},
{name:'GameObjectsApi', path:'controllers/api/GameObjects.js'},
]
process.on('uncaughtException', err => {
console.error(err, 'Uncaught Exception thrown');
}).on('unhandledRejection', (reason, p) => {
console.error(reason, 'Unhandled Rejection at Promise', p);
});
const app = new App();
await app.importModules(modules);
await app.init();
console.log(`Starting...`);
app.start();