3 ms·
Maybe I misunderstand but it's pretty trivial to render different server side output based on context and is common in most frameworks. Just pass a header for
by TrispusAttucks 4y ago
Maybe I misunderstand but it's pretty trivial to render different server side output based on context and is common in most frameworks.
Just pass a header for request content type json. Then the server returns data in json format as opposed to html.
- bigmattystyles 4y agobut then you'll have a server side path for json and one for html. If I have rendering logic client side entirely, then I just have json / xml on the server. That's it.
- TrispusAttucks 4y agoNo. It's one path. The client merely requests the the format it desires. The response handler on the server side returns the appropriate response format as requested by the client. Nothing crazy here.