diff --git a/examples/with-http2/server.js b/examples/with-http2/server.js index 5ec52af1a7cee..80847158308e1 100644 --- a/examples/with-http2/server.js +++ b/examples/with-http2/server.js @@ -17,19 +17,7 @@ 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) - } - }) - + server.on('request', (req, res) => app.render(req, res, req.url, req.query)) server.listen(port) console.log(`Listening on HTTPS port ${port}`)