3 ms·
Rails, by default, will put a “.json” suffix on json routes. This is so supremely useful if you have a Rails api app, speaking to some over complicated front en
by graypegg 3y ago
Rails, by default, will put a “.json” suffix on json routes. This is so supremely useful if you have a Rails api app, speaking to some over complicated front end that might need a quick and dirty mock for something. Just serve your /api/thing.json from somewhere. Only issue is with HTTP verbs other than GET, but usually at that point I need a lot more than this 15second mock. Good for testing little things though.
- Alifatisk 3y agoI was about to say this!
- Lio 3y agoThis also lends itself to easy caching with a versioning key and proxy servers, just like with static files. …I guess that was kind of the point of REST in the first place but it’s easy to forget. REST has a wonderful simplicity to it. I’m yet to hear about an equivalent caching solution for GrqphQL APIs for example.
- nesarkvechnep 3y agoLet me tell you about hypermedia controls and discuss simplicity then? CRUD data API’s are simple, until some level of complexity.