diff --git a/server.js b/server.js index a0c7817..f133c81 100644 --- a/server.js +++ b/server.js @@ -6,13 +6,18 @@ console.log('Hello'); // set the view engine to ejs app.set('view engine', 'ejs'); -// use res.render to load an ejs view file - -app.get('/', function(req, res) { - res.render('pages/index'); -}); - // add folder for static content: app.use(express.static(__dirname + '/assets')); +app.get(/\/.*/, function(req, res) { + console.log(req.path); + let pathname = 'pages' + req.path; + + if ((pathname)[pathname.length - 1] === '/') { + pathname += 'index'; + } + + res.render(pathname); +}); + app.listen(8090); \ No newline at end of file diff --git a/views/pages/contact.ejs b/views/pages/contact.ejs new file mode 100644 index 0000000..90bf7a3 --- /dev/null +++ b/views/pages/contact.ejs @@ -0,0 +1,21 @@ + + + +
+ <% include ../partials/include %> + + + + <% include ../partials/nav %> +As a lonly explorer of the interwebs, I welcome the warm embrace of human contact. Please email me with the below address:
+