For a single page app: ExpressJS or Restify or both?

I'm working with NodeJS + Mongoose, writing one app for one page, so I need to serve up some statics and then all the interaction between frontend and backend is done through XHR. Eventually I am thinking about writing my own mobile application accessing the same server. Is there any pattern / best practice I should be applying here? I thought I might need to fetch the API to show through Restify and only handle requests from the webapp with ExpressJS? or should I just put all the stuff exposed through Restify? I guess my confusion stems from not working with Restify before, so any explanation on how it differs from ExpressJS (especially when it comes to a single page application) is really welcome.


source to share

2 answers

I am implementing a similar solution, mobile app and website with expressjs and backbonejs. I didn't use restify because I didn't think I needed additional complexity, there weren't many API endpoints, so expressjs handled everything just fine for me.

BTW take a look at this post for performance, I just saw it today and don't personally check the content.

Benchmarking Comparison Using PerfectAPI vs. Express.js vs Restify.js "PerfectAPI Blog PerfectAPI



Restify is a package of DTrace and various handlers that Express does not support. If you only have one API endpoint and don't require DTrace, there is no point in running Restify.

Alternatively, you can try express-resource



All Articles