17

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?

Nick
  • 4,002
  • 4
  • 30
  • 41
  • Looks promising and has good documentation. How does it compare to the other active JS API Frameworks? Btw, here's the working link: http://www.actionherojs.com/ – Nick Dec 29 '12 at 22:18

4 Answers4

9

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.

Steve Campbell
  • 3,385
  • 1
  • 31
  • 43
  • I've read those, but I'm still unclear about what advantage PerfectAPI provides over ExpressJS? I understand Express has a web framework. If I had only 3-4 API methods, would I still want to use PerfectAPI? What would I have to implement separately if I don't use use PerfectAPI? Thanks! – Nick May 06 '12 at 22:07
  • 2
    Without perfectapi you would have to write the http stuff, i.e. http headers, response codes, formatting data. Depending on your needs, you may need to code a test page and documentation. If you want to handle load, scaling across cpus will have to be used. – Steve Campbell May 07 '12 at 13:10
  • 13
    For others finding this question, "I am not currently maintaining this package. You should probably look for another tool for what you need.", per the node-perfect homepage. – blu Sep 18 '13 at 15:57
  • node-perfectapi is no longer maintained. So taking it out of my list. – dicemaster Aug 18 '14 at 07:57
  • from node-perfectapi github -> 'I am not currently maintaining this package. You should probably look for another tool for what you need.' – Anselmo Mar 12 '15 at 22:16
5

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.

yadutaf
  • 6,840
  • 1
  • 37
  • 48
5

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.

surui
  • 1,522
  • 12
  • 17
4

If you go to node-perfectapi in github you'll see this message in the readme:

"I am not currently maintaining this package. You should probably look for another tool for what you need."

Therefore I conclude you are better off using restify since this is actively maintained.

Ab Wilson
  • 337
  • 2
  • 4