Files
menui_backend/app.js
Jonasz Bigda 2abec5017f New project structure
New folder structure
Changed to type:module
Moved routes to separate files
2020-07-17 22:07:55 +02:00

21 lines
460 B
JavaScript

import * as config from "./config/index.js";
const { port, dbPass } = config;
import express from "express";
const app = express();
import loaders from "./loaders/index.js";
//
// Server init function
//
async function startServer() {
await loaders({ expressApp: app, dbPass: dbPass });
app.listen(port, (err) => {
if (err) {
console.log("Server Startup Failed");
return;
}
console.log("Server is running");
});
}
startServer();