Remove path specific switch statement from http2 example (#16558)
Is this switch necessary
This commit is contained in:
parent
b5cf3e4c94
commit
e2cdf215bc
1 changed files with 1 additions and 11 deletions
|
@ -17,19 +17,9 @@ const server = http2.createSecureServer({
|
|||
|
||||
app.prepare().then(() => {
|
||||
server.on('error', (err) => console.error(err))
|
||||
|
||||
// Process the various routes based on `req`
|
||||
// `/` -> Render index.js
|
||||
// `/about` -> Render about.js
|
||||
server.on('request', (req, res) => {
|
||||
switch (req.url) {
|
||||
case '/about':
|
||||
return app.render(req, res, '/about', req.query)
|
||||
default:
|
||||
return app.render(req, res, '/', req.query)
|
||||
}
|
||||
app.render(req, res, req.url || '/', req.query)
|
||||
})
|
||||
|
||||
server.listen(port)
|
||||
|
||||
console.log(`Listening on HTTPS port ${port}`)
|
||||
|
|
Loading…
Reference in a new issue