mirror of
https://github.com/len0rd/personal-website.git
synced 2026-01-20 08:40:44 -05:00
started making pre-start script to auto generate md -> html before starting the server. best i can do for now
This commit is contained in:
parent
432e408a2c
commit
ec4931db34
3 changed files with 6 additions and 3 deletions
|
|
@ -1,3 +1,4 @@
|
|||
const PORT = 8090;
|
||||
var express = require('express');
|
||||
var app = express();
|
||||
|
||||
|
|
@ -10,7 +11,7 @@ app.set('view engine', 'ejs');
|
|||
app.use(express.static(__dirname + '/assets'));
|
||||
|
||||
app.get(/\/.*/, function(req, res) {
|
||||
console.log(req.path);
|
||||
console.log('Request for page: ' + req.path);
|
||||
let pathname = 'pages' + req.path;
|
||||
|
||||
if ((pathname)[pathname.length - 1] === '/') {
|
||||
|
|
@ -20,4 +21,4 @@ app.get(/\/.*/, function(req, res) {
|
|||
res.render(pathname);
|
||||
});
|
||||
|
||||
app.listen(8090);
|
||||
app.listen(PORT);
|
||||
Loading…
Add table
Add a link
Reference in a new issue