Thursday, March 9, 2017

Overview of Restify

Restify is a node.js module built specifically to enable you to build correct REST web services. It intentionally borrows heavily from express as that is more or less the de facto API for writing web applications on top of node.js



Express and Restify

Pros

  • Little learning curve, Express is nearly a standard for Node.js web applications.
  • Fully customizable.

Cons

  • All endpoints need to be created manually; you end up doing a lot of the same code (or worse, start rolling your own libraries after a while).
  • Every endpoint needs to be tested (or at the very least I recommend that you hit the endpoints with HTTP consumer to make sure they are actually there and don’t throw 500s).
  • Refactoring becomes painful because everything needs to be updated everywhere.
  • Doesn’t come with anything “standard”, have to figure out your own approach.
  • Express is a great starting point, but eventually you will feel the pain of “roll your own” approach.

Pros

  • Automatic DTrace(comprehensive dynamic tracing framework)  support for all your handlers (if you’re running on a platform that supports DTrace).
  • Doesn’t have unnecessary functionality like templating and rendering.
  • Built in throttling.
  • Built in SPDY support.

Cons

  • The cons are all the same with Restify as they are with Express; lots of manual labor.

No comments:

Post a Comment