Thursday 31 March 2016

How to deal with Restful view presentation on express

I'm working on a project with node.js and express. But I'm confused with the Restful rules.I have a /products resource ."get" operation will return rendered html string that display limited quantity (maybe 50 or 100) products data.The major problem is my other views or other project needs that resource with pure json response , I have to duplicate the database logic to /api/products .Make /api/products with "get" operation responds with json.Am I doing it good? Any more elegant solution can I choose?Thanks for help!

Submitted March 31, 2016 at 09:41AM by silveryiris

No comments:

Post a Comment