Reputation: 6559
Right now I have two routes, invoking the same method.
Let's say the method's name is myMethod And two routes are / and /:params
router.get("/", myMethod);
router.get("/:param", myMethod);
Since in both cases I have to invoke the same method, I want to use a single route to invoke the myMethod. Something like this,
router.get('/' or '/:param', methodName);
If it is possible, then how can I do this?
Upvotes: 0
Views: 628