scottksmith95 / beerlocker

Source code for Beer Locker tutorials
http://scottksmith.com/blog/2014/05/02/building-restful-apis-with-node/
426 stars 263 forks source link

Avoid 'headers send twice', use body parser json handling #3

Closed yamsellem closed 8 years ago

yamsellem commented 8 years ago

In every controller, errors are not returned directly, so a 'headers send twice' error can append. Returning once error avoid this.

The json body parsing needs to be added to handle bodies in express, I guess.

ps. I've also add to update the mongoose version to 4.x, but this is more related to my installation (it's not in this pull request), anyway, upgrading works directly

double ps. thanks a lot for this (very very) detailed explainations