Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



but 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.


No. 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: