package PoorBooru::API::V0; use v5.36; use strict; use warnings; use Mojo::Base "Mojolicious"; use PoorBooru::Schema; sub startup ($self) { $self->moniker("poorbooru-api-v0"); my $config = $self->plugin("Config"); $self->secrets($config->{secrets}); $self->helper(schema => sub { state $schema = PoorBooru::Schema->connect($config->{dsn}) }); my $r = $self->routes; $r->get("/meta")->to("meta#index"); $r->get("/tags")->to("tags#list"); $r->get("/tag/:tag_id_or_name")->to("tags#show"); } 1;