URL fragments and routing
mikekreuzer opened this issue · 2 comments
I'm wondering if there's a way to route based on path fragments. Up until recently I wouldn't have seen the need, but with ActivityPub fragments seem to indicate part of a data object, eg in
app = Hanami::Router.new do
get "/actor", to: ->(env) { ... }
get "/actor#main-key", to: ->(env) { ... }
end
/actor might return JSON describing a user, which includes a bunch of info including the public key they were using;
/actor#main-key could return just that key. Literally a fragment.
I can't see how to do this using Hanami router, env in the example doesn't include the fragment, but forgive me if I'm missing something.
I'm not sure if this is maybe a limitation imposed by Rack.
NB Mastodon (the poster child for ActivityPub) doesn't do this either, /actor & /actor#main-key return the same actor JSON.
@mikekreuzer Thanks, but it isn't a priority.