Issue
I am writing my app and I want to do the following:
On the first request, I serve all the client side code (views, models, controllers, CSS ...) and subsequently I want to do RESTful API calls to the server to populate my app with data.
I've been looking everywhere but can't find a complete example. Connect serves a static directory but after that I don't know how to route RESTful API requests.
Solution
I'd recommend that you use Expressjs on top of Connect for request routing: http://expressjs.com/api.html
Its a very straight forward framework, with tons of tutorials online. Here is a good one for getting started: http://coenraets.org/blog/2012/10/creating-a-rest-api-using-node-js-express-and-mongodb/
Answered By - Chris Tinsley
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.