2017-01-16 20:27:07 +01:00
|
|
|
const pathWrapper = (app, pathName, opts) => ({ raw, query }, hapiReply) =>
|
|
|
|
app.renderToHTML(raw.req, raw.res, pathName, query, opts)
|
|
|
|
.then(hapiReply)
|
2017-01-10 03:35:10 +01:00
|
|
|
|
2017-02-13 03:12:32 +01:00
|
|
|
const defaultHandlerWrapper = app => {
|
|
|
|
const handler = app.getRequestHandler()
|
|
|
|
return ({ raw, url }, hapiReply) =>
|
|
|
|
handler(raw.req, raw.res, url)
|
|
|
|
.then(() => {
|
|
|
|
hapiReply.close(false)
|
|
|
|
})
|
|
|
|
}
|
2017-01-16 20:27:07 +01:00
|
|
|
module.exports = { pathWrapper, defaultHandlerWrapper }
|