diff --git a/lib/PoorBooru/API/V0.pm b/lib/PoorBooru/API/V0.pm index 40100f8..1e73ae2 100644 --- a/lib/PoorBooru/API/V0.pm +++ b/lib/PoorBooru/API/V0.pm @@ -24,16 +24,16 @@ sub startup ($self) my $r = $self->routes; - $r->get("/meta")->to("meta#index"); + $r->get("/meta")->to("meta#index")->name("meta"); - $r->get("/tags")->to("tags#list"); - $r->get("/tag/:tag_id_or_name")->to("tags#show"); + $r->get("/tags")->to("tags#list")->name("tags_list"); + $r->get("/tag/:tag_id_or_name")->to("tags#show")->name("tag_show"); - $r->get("/media")->to("media#list"); - $r->get("/media/:media_id")->to("media#show"); + $r->get("/media")->to("media#list")->name("media_list"); + $r->get("/media/:media_id")->to("media#show")->name("media_show"); - $r->get("/random/media")->to("random#media"); - $r->get("/random/tag")->to("random#tag"); + $r->get("/random/media")->to("random#media")->name("media_random"); + $r->get("/random/tag")->to("random#tag")->name("tag_random"); } 1; diff --git a/lib/PoorBooru/Backend.pm b/lib/PoorBooru/Backend.pm index 35b5355..f8271db 100644 --- a/lib/PoorBooru/Backend.pm +++ b/lib/PoorBooru/Backend.pm @@ -41,11 +41,11 @@ sub startup ($self) my $r = $self->routes; - $r->get("/")->to("media#list"); - $r->get("/media/:media_id")->to("media#show"); + $r->get("/")->to("media#list")->name("media_list"); + $r->get("/media/:media_id")->to("media#show")->name("media_show"); - $r->get("/tags")->to("tags#list"); - $r->get("/tag/:tag_id_or_name")->to("tags#show"); + $r->get("/tags")->to("tags#list")->name("tags_list"); + $r->get("/tag/:tag_id_or_name")->to("tags#show")->name("tag_show"); } 1;