lefnire/habitrpg — pull request #430 by switz (2013-02-19 00:10:39+00:00)
Title: @lefnire => Move api into separate file with new express API

Airplane commits!

This significantly cleans up the codebase for the API. It will allow us to extend the API in a much simpler and cleaner manner.

There's a new `api.coffee` on the server. Instead of passing in a function with `expressApp`, I'm using the new express API introduced in `3.0.6`. Now, everything in `api.coffee` is prefaced with the url `/v1`. To add a route, just use the `router` object exactly like you would `expressApp`. I also moved deprecated to a separate file (as it's not prefaced by v1).

Static is also in a new file. As you can see, the code is much more extensible now. I usually preface any API endpoints with `/api/v1`, but that's your call Tyler. If you decide to move to that route, we could easily redirect any REST requests from the `/v1` endpoint to `/api/v1`.

More pull requests on the way! If you have any questions, ask away.