未验证 提交 f4c160ee 编写于 作者: I Ivan Jovanovic 提交者: Joe Haddad

Custom hapi server example handle static files (#6822)

While implementing hapi as a custom server, I found a minor issue. The example provided isn't showing that we also need to serve static files using next. This change should fix that. Thanks!
上级 e8deecd1
......@@ -32,6 +32,12 @@ app.prepare().then(async () => {
handler: nextHandlerWrapper(app)
})
server.route({
method: 'GET',
path: '/static/{p*}' /* use next to handle static files */,
handler: nextHandlerWrapper(app)
})
server.route({
method: 'GET',
path: '/{p*}' /* catch all route */,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册