PAGI-Tools Examples
This directory contains example applications built on the PAGI toolkit — the higher-level components (Endpoint, Middleware, Apps, Context, Request/Response, etc.) that live in this distribution.
Requirements
- Perl 5.18+ with
Future::AsyncAwait - A PAGI server to run examples against:
Then launch any example with:cpanm PAGI::Serverpagi-server examples/<name>/app.pl --port 5000
Examples assume you understand the core spec (see the PAGI project for spec documents) plus the relevant protocol documents.
Note: Low-level protocol examples (hello-http, streaming-response, websocket-echo
handshake, SSE broadcaster, lifespan-state, extension-fullflush, tls-introspection,
job-runner, utf8) shipped with the PAGI-Server distribution — they demonstrate
raw PAGI protocol details that belong alongside the server implementation.
Example List
09-psgi-bridge- wraps a PSGI app for PAGI use (viaPAGI::App::WrapPSGI)10-chat-showcase- WebSocket chat demo with multiple clients13-contact-form- form parsing and file uploads14-lifespan-utils- lifespan hooks viaPAGI::Utilsapp-01-file- static file serving withPAGI::App::Filebackground-tasks- running background work from within a PAGI appendpoint-demo- high-level HTTP endpoint withPAGI::Endpoint::HTTPendpoint-router-demo- composing routes withPAGI::Endpoint::Routerfull-demo- kitchen-sink demo combining multiple toolkit featuressse-dashboard- server-sent events dashboard withPAGI::Endpoint::SSEtest-lifespan-shutdown- testing graceful lifespan shutdown hookswebsocket-chat-v2- WebSocket chat usingPAGI::Endpoint::WebSocketwebsocket-echo-v2- WebSocket echo usingPAGI::Endpoint::WebSocketwebsocket-bidirectional- full-duplex WebSocket withPAGI::Context: a receive-loop (each_text) and an unsolicited server send-loop running concurrently
Note on websocket-chat-v2/public: this directory is a symlink to
10-chat-showcase/public. It works in git checkouts but is omitted from the
distribution tarball; copy the public/ directory manually if you need it
outside a checkout.
Each example has its own README.md explaining how to run it.