fac-14 / OSCEBossKey

Weeks 13-16 > Tech for Better project: An app to help medical students revise for their exams
https://oscebosskey.herokuapp.com/
MIT License
3 stars 2 forks source link

RESTful endpoint naming #151

Open tbtommyb opened 5 years ago

tbtommyb commented 5 years ago

Endpoints like app.get("/api/history/:station") and app.get("/api/history/:station/case/:id") are well-named but ones like app.post("/api/add-case/:station") are a little confusing.

Generally it is good to try and only refer to the resource name in the end point and then specify the behaviour you want with the HTTP verb. So adding a case to a station would be via a POST to something like /api/stations/:stationId/case.