I started working on a app that will receive a “route” as json. That is the “route” itself will passed as a string to the server enclosed in a json string. I want to use a CRUD standard way of writing routes to keep things more easily debuggable later. However, as follows by example:
contact 'get all contacts
contact/:id 'get the contact by id
Ugly areas:
contact/:id/jobs 'get the contact and all jobs assigned to contact
contact/:id/jobs/filter 'get the contact and all jobs assigned to contact,
'where those jobs meet a certain criteria (filter)
Now I could avoid the ugly areas via routes on “jobs” by having CRUD routes on “jobs”, which I will. But if I wanted limit returned “jobs” to a specific contact as in the above, is there a way to write CRUD syntax for that without making up new conventions?
This will all be implemented in PHP and Javascript, hence those question tags. But it doesn’t really matter the programming languages involved. I’d appreciate any advice relating to designing routes using a CRUD way. Without any particulars involved on frameworks. Just the formatting (spellings) of routes themselves.