Which location is considered the most optimal for setting URL paths in Express routing?
1) Placing the path inside the main file:
// server.js
server.use('/folder', some_router);
// some_router.js
routes.all('/', (req, res) => {
res.status(404).end();
});
2) Including the path inside the router file:
// server.js
server.use(some_router);
// some_router.js
routes.all('/folder', (req, res) => {
res.status(404).end();
});