From 861593d26d581084c34b825f2f4fa830bf82ffd1 Mon Sep 17 00:00:00 2001 From: Lucas Date: Sun, 19 Feb 2023 12:17:51 +0000 Subject: [PATCH] api: inline ROUTES --- lib/PoorBooru/API/V0.pm | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/lib/PoorBooru/API/V0.pm b/lib/PoorBooru/API/V0.pm index 2113355..5e5a190 100644 --- a/lib/PoorBooru/API/V0.pm +++ b/lib/PoorBooru/API/V0.pm @@ -7,16 +7,6 @@ our $VERSION = v0; set serializer => "JSON"; use constant { - ROUTES => [ - { path => "/meta", verb => "GET" }, - { path => "/tags", verb => "GET" }, - { path => "/tags", verb => "POST" }, - { path => "/tag/:tag_id_or_name", verb => "GET" }, - { path => "/media/:media_id", verb => "GET" }, - { path => "/download/:media_id", verb => "GET" }, - { path => "/random", verb => "GET" }, - ], - DEFAULT_CONTENT_TYPE => "application/json", }; @@ -46,7 +36,15 @@ sub mkpager ($) } get "/meta" => sub { - return ROUTES; + return [ + { path => "/meta", verb => "GET" }, + { path => "/tags", verb => "GET" }, + { path => "/tags", verb => "POST" }, + { path => "/tag/:tag_id_or_name", verb => "GET" }, + { path => "/media/:media_id", verb => "GET" }, + { path => "/download/:media_id", verb => "GET" }, + { path => "/random", verb => "GET" }, + ], }; get "/tags" => sub {