Nested-routes
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')