homepage.js/routes/pages.js

29 lines
693 B
JavaScript
Raw Normal View History

2023-03-09 14:26:00 +01:00
const handler = require('express-async-handler');
async function services(req, res) {
res.template('page/services.pug');
}
2023-03-09 14:40:29 +01:00
async function resume(req, res) {
res.template('page/resume.pug');
2023-03-11 15:39:06 +01:00
console.log(process.env.APP_DEBUG);
2023-03-09 14:40:29 +01:00
}
2023-03-09 14:26:00 +01:00
2023-03-11 16:54:53 +01:00
async function about(req, res) {
res.template('about.pug', {
current_route: req.originalUrl
});
}
2023-07-09 03:04:36 +02:00
function phpower(req, res) {
res.redirect('https://www.youtube.com/watch?v=dQw4w9WgXcQ')
}
2023-03-09 14:26:00 +01:00
module.exports = (router) => {
2023-03-09 14:40:29 +01:00
router.get('/services', handler(services))
router.get('/resume', handler(resume))
2023-07-09 03:04:36 +02:00
2023-03-11 16:54:53 +01:00
router.get('/about', handler(about));
2023-07-09 03:04:36 +02:00
// used only in about route
router.get('/power_of_php', phpower);
2023-03-09 14:26:00 +01:00
}