update and verify working locally

This commit is contained in:
len0rd 2021-06-07 18:35:05 -06:00
parent 755be916b8
commit 0e67a57813
4 changed files with 178 additions and 185 deletions

View file

@ -2,7 +2,7 @@ const PORT = 8090;
var express = require('express');
var app = express();
console.log('Starting express server');
console.log('Starting express server on port ' + PORT);
// set the view engine to ejs
app.set('view engine', 'ejs');
@ -13,7 +13,7 @@ app.use(express.static(__dirname + '/assets'));
app.get(/\/.*/, function(req, res) {
let pathname = 'pages' + req.path;
let page = pathname.substr(pathname.lastIndexOf('/') + 1);
if (pathname !== null && pathname !== undefined) {
if ((pathname)[pathname.length - 1] === '/') {
pathname += 'index';