mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
14 lines
424 B
JavaScript
14 lines
424 B
JavaScript
const pathWrapper = (app, pathName, opts) => ({ raw, query }, hapiReply) =>
|
|
app.renderToHTML(raw.req, raw.res, pathName, query, opts)
|
|
.then(hapiReply)
|
|
|
|
const defaultHandlerWrapper = app => {
|
|
const handler = app.getRequestHandler()
|
|
return ({ raw, url }, hapiReply) =>
|
|
handler(raw.req, raw.res, url)
|
|
.then(() => {
|
|
hapiReply.close(false)
|
|
})
|
|
}
|
|
module.exports = { pathWrapper, defaultHandlerWrapper }
|