sampottinger / co_opencampaigndata

API service for serving Colorado TRACER data for opencampaigndata.org
GNU General Public License v3.0
10 stars 1 forks source link

Express setup #23

Closed trinary closed 11 years ago

trinary commented 11 years ago

Getting started with the server stuff. I'm sending the express app into the controller modules so they can add their routes to it rather than having that stuff in server.js, I hope that works out. I'm loading config.json and using it for things like port, we'll probably want a dev/prod environment-like switch at some point. More to do, like getting routing tests, abstracting content negotiation, etc. I've tested some stuff like this in the past with mocha, will need to see how nodeunit tests fit together with this. Will add to this PR till the scaffolding for more issues is in place then break those out.

sampottinger commented 11 years ago

Great! I agree with regards to config.json and I am sure we are on the same page but I was thinking of following https://github.com/visionmedia/express/tree/master/examples/route-separation for route separation. As for nodeunit, please feel free to branch to mocha if you can't get things to work. However, there is also https://github.com/rubymaverick/express-mock-request. :-). All just suggestions.

sampottinger commented 11 years ago

I suppose... with that... https://github.com/rubymaverick/express-mock-request/issues/2. Npm made express-mock-request sound awesome (it might still be). Regardless, I still relegate to your better judgement :).

trinary commented 11 years ago

Hah, just ran into that. I dunno, easy to work around, but not confidence inspiring. I'll give it a shot for now.

trinary commented 11 years ago

Yeah I don't have much confidence in this working. That workaround just triggers more broken interfaces, with Node's http layer this time rather than express.

trinary commented 11 years ago

Really these are turning into acceptance tests, trying this: https://github.com/powmedia/nodeunit-httpclient but again I worry when I see a year+ since it's been touched.

trinary commented 11 years ago

We need to make a list of frontend routes.

I have stubbed out routes and 501 tests (plus content type) for the resources and API index. Think we should merge this and take each endpoint as a story. Content negotiation could be abstracted, bunch of other repetition reduced, but I think we need to crank on functionality quite quickly at this point.

sampottinger commented 11 years ago

All agreed and this pull request looks good to me.