Which Express.js function is used to create an instance of a router object?

  • app.route()
  • express.router()
  • express.Router()
  • app.useRouter()
In Express.js, you create an instance of a router object using express.Router(). Routers are used to modularize routes and middleware. The other options do not create router instances in the standard Express.js way.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *