News for hackers. Stuff that matters.
Re:Ask HN: Nested Resources in REST/HTTP API URLs? by yawnxyz on Thursday August 18, 2022 @11:33PM (#32517358)
I'd do it this way as well for most cases.

Complicated URLs are hard to remember and annoying to share. The one benefit of the nested URL is that you get is of being able to "inspect" what organization or section or comment a piece of content belongs to. This is probably a rare edge case and something you should only implement if it makes your system much more usable, for some reason.

e.g. I'd probably rather have podcastsite.com/:podcastname/:podcastepisode/:comment_id

Re:Ask HN: Nested Resources in REST/HTTP API URLs? by alganet on Friday August 19, 2022 @03:33AM (#32518392)
A cool way of reaping benefits of both approaches is to separate client side and server side URLs.

The thing after the '#', which has been called many things in the past (hash fragment, I guess), never goes into the server, so you can play with it using JavaScript to make it meaningful to users, while keeping it simple and flat on the real HTTP requests.

Re:Ask HN: Nested Resources in REST/HTTP API URLs? by Shorn on Friday August 19, 2022 @08:28PM (#32527755)
That's a neat idea. It's like a self-contained documentation / "comment" of the URL. `#` is even fairly well-known commenting character.