Move creating the router and populating the routes to a separate function outside of ListenAndServe to allow unit tests to make assertions on the configured routes and handler funcs. Upstream-commit: 0a28628c02d486512dc7e62eb54ccfd27eaa0a27 Component: engine