function baseHtml(content) {
return '<html><body>' + content + '</body></html>'
}
each(routes, function (module, route) {
var onmatch = module.onmatch || (() => module)
var render = module.render || identity
app.get(route, function (req, res, next) {
res.type('html')
Promise.resolve()
.then(() => onmatch(req.params, req.url))
.then(render)
.then(toHtml)
.then(baseHtml)
.then(res.send.bind(res))
.catch(next)
})
})
module.exports = app
toHtml
is mithril-node-render