Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the usage of namespaces #21

Merged
merged 1 commit into from
Dec 2, 2017
Merged

Allow the usage of namespaces #21

merged 1 commit into from
Dec 2, 2017

Conversation

victor-am
Copy link
Owner

@victor-am victor-am commented Nov 20, 2017

This PR introduces a namespace feature that works like this:

api.namespace('admin').list('users')
// => admin/users

api.namespace('blog_posts/:id', { id: 1 }).list('users')
// => blogs/1/users

The resource feature now works on top of the namespace function, so this:

api.resource('blogPosts', 1)

Is the same as this:

api.namespace('blog_posts/:id', { id: 1 })

Pending

  • Documentation on README

Closes #1

@victor-am victor-am added the wip label Nov 20, 2017
@victor-am victor-am self-assigned this Nov 20, 2017
@ghost ghost added the in progress label Nov 20, 2017
@victor-am victor-am removed the wip label Nov 20, 2017
* //=> GET request to '/admin/blog_posts' path
*/
namespace (namespace) {
// TODO

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO found

* //=> { path: '/admin/blog_posts', params: {} }
*/
namespace (namespace) {
// TODO

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO found

@victor-am victor-am force-pushed the namespaces branch 3 times, most recently from 58501b3 to b2d6945 Compare December 2, 2017 19:12
@victor-am victor-am added this to the v1.0 milestone Dec 2, 2017
@victor-am victor-am merged commit 3fc5f57 into master Dec 2, 2017
@ghost ghost removed the in progress label Dec 2, 2017
@victor-am victor-am deleted the namespaces branch December 2, 2017 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant