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

Resource should be composite #6

Closed
guregodevo opened this issue Apr 20, 2014 · 1 comment
Closed

Resource should be composite #6

guregodevo opened this issue Apr 20, 2014 · 1 comment

Comments

@guregodevo
Copy link
Owner

A resource can be added to another resource and behave as any resource.
For example :
Resource Person can be added to resource URI company.

(personResource) Get(...) {
}

(personResource) Post(...) {
}

...
resource := CompanyResource
personResource := PersonResource

resource.embed("/:companyname/employee",personResource)
api.AddResource("/company", resource)
api.Start(54666)

View employees of the company named "Huston" should be view at URI /company/
curl http://locahost:54666/huston/employee

@guregodevo
Copy link
Owner Author

There is no need to add extra services to make resource composite. Adding a nested resource to a parent resource URI is easy enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant