We create the next request handler function via app.getRequestHandler()
. This returns a standard express handler, so we use it like expressApp.get('*', middlewareA(), middlewareB(), nextApp.getRequestHandler())
.
When the handler is invoked:
- Server#handleRequest (next-server/server/lib/next-server.js)
- Parses URL + query string if not already done
- Server#run
- Searches for matching route