gilest/briefly — pull request #2 by tuttinator (2014-04-08 09:39:53+00:00)
Title: API

The start of a public api, which can then be used by mobile apps (like a RubyMotion app).

It's extremely basic - just rendering out the list of articles as JSON. We might want to trim some of those attributes (such as 'created_at' and 'updated_at' which can be misleading if an editor re-used an article already in a certain position and just changed the link - this could be via defining ``as_json`` on the model).

Something to note that may be an annoying in development: the routes file does have a subdomain constraint for 'api', expecting a route of:

``api.briefly.co.nz/v1/articles.json``

In development it might be helpful to add this to ``/etc/hosts``:

``127.0.0.1 api.briefly.local``

The API controller also only responds to json.