daily pastebin goal
27%
SHARE
TWEET

Untitled

a guest Dec 9th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const express = require('express');
  2. const app = express();
  3. const layout = require('./layout');
  4. const { PageMapper } = require('web-components-node');
  5. const pageMapper = new PageMapper('app/pages');
  6.  
  7. // Page route
  8. app.get('/*', async (req, res) => {
  9.   const { body, title } = await pageMapper.findPage(req.path)();
  10.   res.send(layout({ body, title }));
  11. });
  12.  
  13. app.listen('3001', () => console.log(`Example app running on port 3001`));
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top