const next = require('next')
const http2 = require('http2')
const fs = require('fs')

const port = parseInt(process.env.PORT, 10) || 3000
const dev = process.env.NODE_ENV !== 'production'

// Init the Next app:
const app = next({ dev })

// Create the secure HTTPS server:
// Don't forget to create the keys for your development
const server = http2.createSecureServer({
  key: fs.readFileSync('localhost-privkey.pem'),
  cert: fs.readFileSync('localhost-cert.pem'),
})

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.listen(port)

  console.log(`Listening on HTTPS port ${port}`)
})

@@ -545,312 +545,82 @@
 r))%0A
-%0A  // Process the various routes based on %60req%60%0A  // %60/%60      -%3E Render index.js%0A  // %60/about%60 -%3E Render about.js%0A  server.on('request', (req, res) =%3E %7B%0A    switch (req.url) %7B%0A      case '/about':%0A        return app.render(req, res, '/about', req.query)%0A      default:%0A        return app.render(req, res,
+  server.on('request', (req, res) =%3E %7B%0A    app.render(req, res, req.url %7C%7C
  '/'
@@ -636,20 +636,13 @@
 ry)%0A
-    %7D%0A
   %7D)%0A
-%0A
   se

Remove path specific switch statement from http2 example (#16558)