Skip to content

Commit 8607a81

Browse files
committed
Merge pull request #2385 from sahat/patch-1
Fix Express deprecated usage warning
2 parents 265ca88 + a798435 commit 8607a81

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/guides/advanced/ServerRendering.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ serve((req, res) => {
2323
// the original request, including the query string.
2424
match({ routes, location: req.url }, (error, redirectLocation, renderProps) => {
2525
if (error) {
26-
res.send(500, error.message)
26+
res.status(500).send(error.message)
2727
} else if (redirectLocation) {
2828
res.redirect(302, redirectLocation.pathname + redirectLocation.search)
2929
} else if (renderProps) {
30-
res.send(200, renderToString(<RoutingContext {...renderProps} />))
30+
res.status(200).send(renderToString(<RoutingContext {...renderProps} />))
3131
} else {
32-
res.send(404, 'Not found')
32+
res.status(404).send('Not found')
3333
}
3434
})
3535
})

0 commit comments

Comments
 (0)