

Building REST APIs with Node.js - jawerty
http://wrightdev.herokuapp.com/post/5105ae1a9aee470200000003/Build-REST-APIs-with-node.js

======
chrisennis
As someone who has built APIs on node+express, I love it for small lightweight
API's that require very little processing beyond getting data from a database
and returning it.

I have gone through much frustration though when I needed to use it for an API
that required processing that only made sense to handle synchronously. At that
point, it becomes less practical.

~~~
ishbits
Why would one use Express to a purely services based app instead of just using
straight up node?

~~~
nateweiss
Also consider using Connect (on which Express is built) as an in-between
point. You get stuff like the Sinatra-style routing, but without the
presentation-tier stuff like template support, etc. I've had good luck with
it, FWIW.

------
byoung2
I'd also recommend Restify <http://mcavage.github.com/node-restify/> for
writing API's on Node.

~~~
helper
I second this recommendation. Restify is targeted at APIs so it has built in
support for things like API versioning, auto content negotiation and
observability (via DTrace). This is not to say that express is bad or that you
can't build APIs using express but rather that I find restify more enjoyable
to use for APIs.

~~~
qdnguyen
And lighter!

------
dxchester
If you're building REST APIs with Express and MySQL, check out this project
I'm working on called Epilogue: <https://github.com/dchester/epilogue>

With Epilogue, once you define your models (with Sequelize), from there it's
easy to get basic CRUD functionality and endpoints in a few lines of code.

------
shtylman
You should not use '*' in dependencies ever! As history changes your app WILL
break.

app.configure is also no longer needed. Just configure everything at the top
level. If you have different config based on environment, use an if statement
or some flag off the process.env

------
cmwelsh
It would be a nicer example to use "pretty SEO URLs" for the individual post
resources instead of a GET variable. I know even the Hacker News website goes
against this, but it just looks more professional/polished to me, i.e.

    
    
        /posts/mytitle

~~~
jawerty
I thought it would be better to have querying in the example to make it
simpler to understand.

------
baugarten
I am also working on a framework for quickly building REST APIs in node.

The project is currently at <https://github.com/baugarten/node-restful> and
under development

