Search code examples
node.jsexpressrestify

Nodejs: Expressjs and Restify structure


I planned to design a web app that provides apis and web site, this is because the app can be used with mobile.

I'm currently using node-restify to provide the api, but now I need a way to serve dynamic pages of the app.

My initial idea was to use just ExpressJS to provide pages and APIs but I've read node-restify is much faster. Now my problem is that with restify I cannot serve html pages rendered in ejs.

Is there a way to have one app only and integrate express with restify.

Any suggestion?


Solution

  • It's interesting what you've written here, because according to this benchmark (16th March 2012):

    http://blog.perfectapi.com/2012/benchmarking-apis-using-perfectapi-vs-express.js-vs-restify.js/

    Restify is a lot slower then Express.

    Express can easily handle ~1500 requests per second while Restify only ~250 per second.

    But even if they already improved Restify I doubt that it can be faster then Express which is already extremely fast. Not to mention that it is entire framework with very useful other tools.

    Concluding: use Express.js.