Skip to content

Instantly share code, notes, and snippets.

@southpolesteve
Created April 22, 2013 03:51
Show Gist options
  • Save southpolesteve/5432337 to your computer and use it in GitHub Desktop.
Save southpolesteve/5432337 to your computer and use it in GitHub Desktop.
I have been playing with a lot of client side apps lately (mostly Ember). Writing the APIs to back these is often a bit tedious. I find myself writing code over and over to match Ember Data's expectations when really I just wanted Rails to automatically expose my models as these APIs. I struggled to find an existing gem that did this.
So over the past couple weekends, I built one: https://github.com/southpolesteve/api_engine
What is it? A Rails engine that automatically exposes your models in a Ember compatible API (including bulk operations). Serialization is done via Active Model Serializers. There is still a bit to be done before it is ready for wide release, but the basic functionality works.
Short term issues
- Add ability to create a model white list.
- Add ability to restrict exposed actions on a model.
- Do a proper release on rubygems
Medium term plans:
- Add auto generated documentation. Maybe an ember app that queries your own API? I think this is a big hole in current API gems. The auto generated docs are non existant or they suck.
Long term goals:
- Come up with a "best practices" auth solution and implement that in the engine.
I would love to get your feedback, suggestions, or even pull requests :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment