I'm new to ExpressJS. I want to create API's for my service which will be consumed directly by other servers and also a part of it by mobile apps/browsers. I just discovered Restify, Node-PerfectAPI, Node-APIServer and I don't know what the differences are.
Can someone kindly elaborate on the differences of each framework and the advantages/disadvantages.
Why would one choose Express/NodeJS vs. Other Frameworks for creating API'S?
NodeJS is an event-driven, non-blocking I/O model using JavaScript as its main language. It helps to build scalable network applications. Express is a minimal and flexible Node. js web application framework that provides a robust set of features for web and mobile applications.
It is unmaintainedExpress has not been updated for years, and its next version has been in alpha for 6 years. People may think it is not updated because the API is stable and does not need change.
restify is a node. js module purpose built to create REST web services in Node. restify makes lots of the hard problems of building such a service, like versioning, error handling and content-negotiation easier.
Disclaimer: I am the author of node-perfectapi.
The focus of perfectapi is to make it simple for the developer to go from start to production-ready. It is more abstracted than node-restify. The impact of that is you have less flexibility in the design of your API, but at the same time, you should be able to get something production-ready much quicker, with less expertise.
Both restify and perfectapi have comparable performance.
The links in this answer go to pages that highlight the benefits of each solution.
I'm also working on a similar issue. One of the main difference that may interest you is the performance. I just found a blog post from the developer of "perfect-api" comparing his framework to the 2 others. http://blog.perfectapi.com/2012/benchmarking-apis-using-perfectapi-vs-express.js-vs-restify.js/
A comment states that Restify is doing much better now.
From my (limited) experience, I would say that express.js is easier to use than Restify and provides some nice tools as connect.js which is exposed. For example, this will avoid you the pain of writing a static file server even thought Connect can still be integrated with Restify.
On the other hand, Restify will make some common API tasks much easier. For example, it provides a throttle engine along with an API conversioning system which is really necessary in an environment where you deal with clients you do not control.
You should also consider https://npmjs.org/package/hapi
It looks very promising. There's a talk about the framework in https://www.youtube.com/watch?v=Recv7vR8ZlA where the main contributor to hapi talks about what makes an API framework tick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With