News for hackers. Stuff that matters.
Re:Ask HN: Nested Resources in REST/HTTP API URLs? by pan69 on Thursday August 18, 2022 @11:35PM (#32517371)
> If you _want_ to have some sort of hierarchy in the URL, you can redirect:

> - /organizations/123/blogs/1234 -> /blogs/1234

And:

/organizations/123/blogs -> /blogs?organization_id=123

Because what you're doing is just applying a filter to an index of blog resources.

I.e. the "/organizations/123/blogs" route is simply an alias to "/blogs?organization_id=123" which you can just redirect to in your gateway.

There are no comments on this comment yet.