Nested-routes

#live demo #source code

Nested Route by calling next() and res.subRoute()

import SMERouter from 'sme-router'

const router = new SMERouter('router-view')

router.route('/main', (req, res, next) => {
  next(`
    <h2>Main title</h2>
    ${res.subRoute()}
  `)
})

router.route('/main/:content', (req, res, next) => {
  res.render(
    `Iam nested content`
  )
})

router.go('/main/sample')
Last Updated: 8/10/2018, 1:49:32 AM