Initial commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import express from "express";
|
||||
import expressLayouts from "express-ejs-layouts";
|
||||
|
||||
import router from './routes/website.js';
|
||||
import apiRouter from './routes/api.js';
|
||||
import DataManager from './modules/datamanager.js';
|
||||
|
||||
const dataManager = new DataManager();
|
||||
global.dataManager = dataManager;
|
||||
dataManager.readRoutes();
|
||||
setInterval(dataManager.saveRoutes, 10 * 60 * 1000);
|
||||
|
||||
const app = express();
|
||||
|
||||
app.use("/api", apiRouter);
|
||||
app.use(express.static("public"));
|
||||
|
||||
app.use(expressLayouts);
|
||||
app.set("layout", "./layouts/default");
|
||||
app.set("view engine", "ejs");
|
||||
app.set("views","views");
|
||||
|
||||
app.use("/", router);
|
||||
|
||||
app.listen(80, function(){
|
||||
console.log("Server gestartet auf Port 80.");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user