Adee
Adee

Reputation: 377

Loopback - how to determine the name of the method based on the endpoint

Loopback 3

My Customer method extends the User method. In addition, I have an endpoint:

GET / Customers / {id} / orders

How to check the method name of the endpoint GET /Customers/{id}/orders?

I need it for the property name in ACL generator

Upvotes: 0

Views: 81

Answers (1)

Ayush Mahajan
Ayush Mahajan

Reputation: 649

GET / Customers/id/orders

in router for /Customers

router.get('/:id/orders',function(req,res,next){
   code whatever you wish
});

you can extract value of id as req.params.id

Upvotes: 0

Related Questions