No, you canβt. This is not how you should do routing. Routes must be well defined in order to have reasonable uris.
For example, I wrote the following routes
app.get ("/ blog", controller.index);
app.get("/blog/new", controller.renderCreate); app.get("/blog/:postId/edit", controller.renderEdit); app.get("/blog/:postId/:title?", controller.view); app.post("/blog", controller.createPost); app.put("/blog/:postId", controller.updatePost); app.del("/blog/:postId", controller.deletePost);
This means that you have full control over the URIs you want.
You are strongly advised to define the uris you want manually and connect them to any controller object that you want.
This means that your uris remains pretty, semantic and fully controlled.
source share