Middleware in PAGI
A port of the sample app from What Is Middleware? — which builds the same three-layer stack in Plack/PSGI (Perl) and Starlette/ASGI (Python) — to PAGI, an async, ASGI-style application interface for Perl.
The app is deliberately tiny but exercises the three things middleware exists to do:
Logger — wrap the request, time it, log method/path in and status/duration out.
Authenticator — inspect a header, inject context for downstream layers on success, or short-circuit with a 401 on failure.







