Router instance mounted explicitly at '//' exposes routes when path begins only with a single /:
const TestRoutes = express.Router();
TestRoutes.get('/drop/table/:table', (req, res) => {
// drop table
res.send(`Dropped table '${req.params.table}'`);
})
TestRoutes.get('/', sendListOfTestRoutes);
if (TEST) app.use('//', TestRoutes);
app.listen();
Expected behavior is that navigating to http://hostname/ would bypass this Router and go to the main app, but instead Express serves the list of test routes mounted within the router at //.
Routerinstance mounted explicitly at'//'exposes routes when path begins only with a single/:Expected behavior is that navigating to
http://hostname/would bypass thisRouterand go to the main app, but instead Express serves the list of test routes mounted within the router at//.