An API engine for Rails. Convention over configuration. Auto generated docs (coming soon!)
You should use this gem if:
- You want to add an API to your Rails app in just a few lines of code
- You don't want to spend time writing controller code for your API
- You want an API compatible with Ember Data
- Add
gem "api_engine", "~> 0.0.1"
to your gem file - Generate an initializer:
rails generate api_engine:config
- Add
mount ApiEngine::Engine => "/api"
to your routes file
By default all of your models will be exposed in a bulk REST API at /api/:model_name
. To expose only certain models, use the whitelist config option:
ApiEngine.configure do |config|
config.whitelist = [:comment] # Exposes only the 'Comment' model via the API
end
Coming soon! There is an open issue for this
Looking for some other resources for creating more complex APIs? Check out these gems...
- https://github.com/intridea/grape
- https://github.com/polleverywhere/cerealizer
- https://github.com/apotonick/roar
- https://github.com/mavenlink/brainstem
Creating an issue is good. Sending a pull request is better.
Copyright 2013 Steven Faulkner
Released under the MIT License. See LICENSE.md for full text