Node.js · Middle · Question 31 of 75
What is express.Router() used for?
- 1Redirecting all traffic to HTTPS
- ✓Correct answer: Grouping related routes and middleware into a module that can be mounted at a path
- 3Starting a second server
Explanation
For example, a users router mounted with app.use("/users", usersRouter). It keeps large apps organized.