Last active
August 29, 2015 13:57
-
-
Save jimsynz/9881687 to your computer and use it in GitHub Desktop.
Discussion about API for mapping endpoints in EPF, similar in concept to the Ember router.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For example: | |
App.Adapter = Ep.RestAdapter.extend | |
namespace: '/api/v1/' | |
routes: | |
# some magic DSL. |
so, I'm thinking something like:
routes:
posts: '/posts/:post_id'
comments: '/posts/:post_id/comments/:comment_id'
EPF could work it out for itself that comments need posts?
how to encapsulate all the CRUD operations?
Also, would be super happy to pair on this feature with you.
I was thinking something a little heavier e.g.: https://gist.github.com/ghempton/9882197, but I am starting to like the simplicity of what you have here. The devil will be in the details
I kind of think that less code is better. But it might be awesome to be able to do what rails does:
resources :posts do
resources :comment do
get :read, on: :member
get :close_comments, on: :collection
end
end
... and be able to dynamically inject actions too.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Carried on from twitter discussion with @ghempton, https://twitter.com/ghempton/status/450413062512594944