Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
2c28e122
Commit
2c28e122
authored
Jul 16, 2019
by
Eduardo P. Rivero
Committed by
Tim Neutkens
Jul 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(web): Passing actual status code instead 200 (#7735)
parent
90280c86
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
next-wrapper.js
examples/custom-server-hapi/next-wrapper.js
+6
-4
No files found.
examples/custom-server-hapi/next-wrapper.js
View file @
2c28e122
...
...
@@ -5,19 +5,21 @@ const nextHandlerWrapper = app => {
return
h
.
close
}
}
const
defaultHandlerWrapper
=
app
=>
async
({
raw
:
{
req
,
res
},
url
})
=>
{
const
defaultHandlerWrapper
=
app
=>
async
({
raw
:
{
req
,
res
},
url
}
,
h
)
=>
{
const
{
pathname
,
query
}
=
url
return
app
.
renderToHTML
(
req
,
res
,
pathname
,
query
)
const
html
=
await
app
.
renderToHTML
(
req
,
res
,
pathname
,
query
)
return
h
.
response
(
html
).
code
(
res
.
statusCode
)
}
const
pathWrapper
=
(
app
,
pathName
,
opts
)
=>
async
({
raw
,
query
,
params
})
=>
{
return
app
.
renderToHTML
(
const
pathWrapper
=
(
app
,
pathName
,
opts
)
=>
async
({
raw
,
query
,
params
}
,
h
)
=>
{
const
html
=
await
app
.
renderToHTML
(
raw
.
req
,
raw
.
res
,
pathName
,
{
...
query
,
...
params
},
opts
)
return
h
.
response
(
html
).
code
(
raw
.
res
.
statusCode
)
}
module
.
exports
=
{
pathWrapper
,
defaultHandlerWrapper
,
nextHandlerWrapper
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment