```
const route = Router();
router.get('user/:UserId');
router.post('user/:UserId');
router.put('user/:UserId');

```

I have the above routes for user REST api's, i wanted to have a user by location api. so i tried something like below.

```
router.get('user/getUserByLocation');

```

The problem is it calls the `router.get('user/:UserId');` as it finds the getUserByLocation as UserId.

I changed the `router.get('user/getUserByLocation');` to `router.get('getUserByLocation');` it works.

My question is , is the above solution the best approach or i need to use the `router.get('user');` with querystring to get the getUserByLocation.