From d712d457639bea9e583aec6805c70f7fbc0bc4b9 Mon Sep 17 00:00:00 2001 From: nightly Date: Wed, 7 Sep 2022 09:12:24 +0200 Subject: [PATCH] Tidy it up a bit --- Components/webserver.js | 17 ++++------------- Templates/{app.ejs => index.ejs} | 0 2 files changed, 4 insertions(+), 13 deletions(-) rename Templates/{app.ejs => index.ejs} (100%) diff --git a/Components/webserver.js b/Components/webserver.js index 7cefab5..fd54c24 100644 --- a/Components/webserver.js +++ b/Components/webserver.js @@ -1,28 +1,19 @@ // Import things const express = require('express'); -const { is } = require('express/lib/request'); -const res = require('express/lib/response'); const app = express(); -const path = require('path'); const server = require('http').createServer(app); const port = process.env.PORT || 3430; -var fs = require('fs');; -// Database for the demo site, -var demoDB = [ - { - name: "Poggere" - } -]; - -// Use /Public as the path for css and such +// Set the templates folder for the thingy app.set('views', __dirname + '/../Templates'); app.set('view engine', 'ejs'); + +// Makes it so that the Public folder mounts under / app.use(express.static(__dirname + '/../Public')); // Main page app.get('/', function(req, res){ - res.render('app', {site:1, db: demoDB}); + res.render('index'); }); // Simple way to expose a function diff --git a/Templates/app.ejs b/Templates/index.ejs similarity index 100% rename from Templates/app.ejs rename to Templates/index.ejs