web config

This commit is contained in:
2020-10-07 20:21:58 +02:00
parent 04dc43de9d
commit 8437ea4682
2 changed files with 59 additions and 0 deletions

24
app.mjs Normal file
View File

@@ -0,0 +1,24 @@
import * as config from "./config/index.js";
const { port, dbPass, cookiesSecret } = 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,
secret: cookiesSecret,
});
app.listen(port, (err) => {
if (err) {
console.log("Server Startup Failed");
return;
}
console.log("Server is running");
});
}
startServer();