Skip to content

Instantly share code, notes, and snippets.

@jimsynz
Last active August 29, 2015 13:57
Show Gist options
  • Save jimsynz/9881687 to your computer and use it in GitHub Desktop.
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.
# For example:
App.Adapter = Ep.RestAdapter.extend
namespace: '/api/v1/'
routes:
# some magic DSL.
@jimsynz
Copy link
Author

jimsynz commented Mar 30, 2014

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?

@jimsynz
Copy link
Author

jimsynz commented Mar 30, 2014

how to encapsulate all the CRUD operations?

@jimsynz
Copy link
Author

jimsynz commented Mar 30, 2014

Also, would be super happy to pair on this feature with you.

@ghempton
Copy link

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

@jimsynz
Copy link
Author

jimsynz commented Mar 31, 2014

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