InterviewBuddy
All interview questions

What is an Express Router used for?

Beginner

Answer

A Router groups related routes and middleware into a module that can be mounted under a path.

Explanation

It helps keep growing applications organized around features.

Example

const users = express.Router(); app.use('/users', users);