1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/examples/custom-server-hapi/next-wrapper.js

9 lines
306 B
JavaScript
Raw Normal View History

2017-01-16 19:27:07 +00:00
const pathWrapper = (app, pathName, opts) => ({ raw, query }, hapiReply) =>
app.renderToHTML(raw.req, raw.res, pathName, query, opts)
.then(hapiReply)
const defaultHandlerWrapper = app => ({ raw, url }, hapiReply) =>
app.run(raw.req, raw.res, url)
2017-01-16 19:27:07 +00:00
module.exports = { pathWrapper, defaultHandlerWrapper }