add about route

This commit is contained in:
b1ek 2023-02-22 16:43:12 +10:00
parent 4bf345b541
commit 901e2d27cd
3 changed files with 23 additions and 0 deletions

View File

@ -19,6 +19,7 @@
"crc-32": "^1.2.2",
"dotenv": "^16.0.3",
"express": "^4.18.2",
"express-async-handler": "^1.2.0",
"express-session": "^1.17.3",
"glob": "^8.1.0",
"gulp": "^4.0.2",

12
routes/about.js Normal file
View File

@ -0,0 +1,12 @@
const Helpers = require('../helpers');
const handler = require('express-async-handler');
async function about(req, res) {
res.send(await Helpers.ViewLoader.load('about.pug', {
current_route: req.originalUrl
}));
}
module.exports = (router) => {
router.get('/about', handler(about));
}

10
view/about.pug Normal file
View File

@ -0,0 +1,10 @@
extends layout/main.pug
block root
- var title = 'About me'
include ui/label.pug
block content
h2 About me page
hr
p
+label('TODO:', '#a3f4bf')
| Write about me