Enable PUT url on a model using replaceById

7 views
Skip to first unread message

ashcs...@gmail.com

unread,
Oct 6, 2017, 2:40:20 AM10/6/17
to LoopbackJS
Hi All,

I have a Customer model. I want only selected remote methods to be enabled. I am using the following code to achieve that.

"customer": {
"dataSource": "mongodb",
"public": true,
 
"options": {
   
"remoting": {
 
"sharedMethods": {
   
"*": false,
   
"findById": true,
   
"deleteById": true,
   
"testLogin": true,
   
"replaceById": true
 
}
   
}
 
}
}

Enabling replaceById enables the following API:


I want the PUT request to be enabled. 

Alternatively I can also use disableRemoteMethods method to disable unwanted APIs.

How do I achieve that ? Also, which one of the above is the correct approach to disable remote methods? 

Thanks

Reply all
Reply to author
Forward
0 new messages