feathersjs / feathers

The API and real-time application framework
https://feathersjs.com
MIT License
14.97k stars 744 forks source link

Multiple API end points for single service #3358

Closed eramudeep closed 7 months ago

eramudeep commented 7 months ago

I am new to feathersjs i am very much confused about the endpoints. Consider I created a Service Named game now I have one endpoint which is game which will support 'find', 'get', 'create', 'patch', 'remove' But i wanted to create an endpoint like game/active-game and fetch only one record which has status:'active' i am very much confused :(

Complexlity commented 7 months ago

Hello @eramudeep , you can get active-game via the get method. After getting it then you call fetch the record using the id and throw some kind of error if the id passed is not active-game

image Image from https://feathersjs.com/guides/basics/services.html

The get method contains an Id argument which represents any more query params after the service name image Image from https://feathersjs.com/api/services.html