2 ms·
You can do this already. I've done it on a few client projects, mostly to make an instant API for my own JS needs on any page. Make it so every page extension
by enobrev 15y ago
You can do this already. I've done it on a few client projects, mostly to make an instant API for my own JS needs on any page.
Make it so every page extension can be changed to .json, and the response is the data used to build that page.
This is exceptionally easy if you're using a templating library. Just check the extension on the current url and respond in that format (I've done the same with XML and PDF when necessary).