# Pastebin 2UL7Pamb my $application = route { before PFAPI::Authenticate; get -> 'character', $id { request-body -> %request { my $character = Character.^load($id); note "[{ DateTime.now }] Performing lookup on $id"; if $character { content 'application/json', $character.to-json; } else { not-found; } } } } class PFAPI::Authenticate does Cro::HTTP::Middleware::Request { method process(Supply $requests) { $requests.do: -> $req { with $req.body('auth') -> $uuid { my $user = User.^load(:$uuid); unless $user { forbidden }; } } } }