Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const express = require('express');
- const app = express();
- const layout = require('./layout');
- const { PageMapper } = require('web-components-node');
- const pageMapper = new PageMapper('app/pages');
- // Page route
- app.get('/*', async (req, res) => {
- const { body, title } = await pageMapper.findPage(req.path)();
- res.send(layout({ body, title }));
- });
- app.listen('3001', () => console.log(`Example app running on port 3001`));
Add Comment
Please, Sign In to add comment