NAME

  HTTP::Handy - A tiny HTTP/1.0 server for Perl 5.5.3 and later

SYNOPSIS

  use HTTP::Handy;

  my $app = sub {
      my $env = shift;
      return [200, ['Content-Type', 'text/plain'], ['Hello, World!']];
  };

  HTTP::Handy->run(app => $app, port => 8080);

DESCRIPTION

  HTTP::Handy is a single-file, zero-dependency HTTP/1.0 server for Perl.
  It implements a subset of the PSGI specification and is designed for
  personal use, local tools, and rapid development.

  On startup, run() automatically creates an Apache-like directory layout
  (logs/, logs/access/, logs/error/, run/, htdocs/, conf/) and begins
  writing access logs to logs/access/ (10-minute LTSV rotation) and error
  logs to logs/error/error.log, in addition to STDERR.

  HTTP::Handy is NOT intended for production or internet-facing deployment.

INCLUDED DOCUMENTATION

  The eg/ directory contains sample programs:

    eg/01_hello_world.pl   Minimal PSGI app (routing, query string)
    eg/02_static_files.pl  Static file serving with cache control
    eg/03_form_post.pl     HTML form, POST body, parse_query
    eg/04_ltsv_viewer.pl   LTSV log viewer, is_htmx, status codes

  The doc/ directory contains PSGI cheat sheets in 21 languages
  (English, Japanese, Chinese, Korean, French, and 16 more).
  Each sheet covers the PSGI interface, run() options, $env keys,
  routing patterns, response builders, and official spec links.

INSTALLATION

  Manual (no build tools required):

    cp lib/HTTP/Handy.pm /path/to/your/project/

  Via CPAN:

    cpan HTTP::Handy
    cpanm HTTP::Handy

  Via perl Makefile.PL:

    perl Makefile.PL
    make
    make test
    make install

  Via pmake.bat (Windows, no make required):

    pmake.bat test
    pmake.bat install

DEMO

  Run the built-in demo from the distribution directory:

    perl lib/HTTP/Handy.pm           # port 8080 (default)
    perl lib/HTTP/Handy.pm 9090      # port 9090

  Then open http://localhost:8080/ in your browser.

COMPATIBILITY

  This module works with Perl 5.005_03 and later.

  WHY PERL 5.005_03 SPECIFICATION?

  This module adheres to the Perl 5.005_03 specification--not because we
  use the old interpreter, but because this specification represents the
  simple, original Perl programming model that makes programming enjoyable.

  THE STRENGTH OF MODERN TIMES

  Some people think the strength of modern times is the ability to use
  modern technology. That thinking is insufficient. The strength of modern
  times is the ability to use ALL technology up to the present day.

  By adhering to the Perl 5.005_03 specification, we gain access to the
  entire history of Perl--from 5.005_03 to 5.42 and beyond--rather than
  limiting ourselves to only the latest versions.

  Key reasons:

  - Simplicity: Original Perl approach keeps programming "raku" (easy/fun)
  - JPerl: Final version of JPerl (Japanese Perl)
  - Universal: Runs on ALL Perl versions (5.005_03 through 5.42+)
  - Philosophy: Programming should be enjoyable (Camel Book readers know!)

  Perl 5.6+ introduced character encoding complexity that made programming
  harder. By following the 5.005_03 specification, we maintain the joy of
  Perl programming.

TARGET USE CASES

  - Local development and rapid prototyping
  - Personal tools and utilities
  - Embedded scripting
  - Educational use

LIMITATIONS

  - HTTP/1.0 only (no Keep-Alive, no HTTP/1.1, no HTTP/2)
  - GET and POST only (HEAD, PUT, DELETE etc. return 405)
  - Single process, single thread (one request at a time)
  - No HTTPS (use a reverse proxy such as Caddy for TLS)
  - No chunked transfer encoding
  - POST body fully buffered in memory (max 10 MB by default)
  - No cookie or session management
  - Log files created relative to the process working directory

AUTHOR

  INABA Hitoshi <ina@cpan.org>

COPYRIGHT AND LICENSE

  This software is free software; you can redistribute it and/or modify
  it under the same terms as Perl itself.

  See http://www.perl.com/perl/misc/Artistic.html
