John Beppu > Squatting-On-HTTP-Engine-0.05 > Squatting::On::HTTP::Engine

Download:
Squatting-On-HTTP-Engine-0.05.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.05   Source  

NAME ^

Squatting::On::HTTP::Engine - run Squatting apps on top of HTTP::Engine

SYNOPSIS ^

Squatting on top of HTTP::Engine::Interface::ServerSimple

  # app_server_simple.pl

  #!/usr/bin/perl
  use strict;
  use warnings;
  use App 'On::HTTP::Engine';
  App->init;
  App->http_engine(
    interface => {
      module => 'ServerSimple',
      args   => {
        host => 'localhost',
        port => 2222,
      },
    },
  )->run;

Squatting on top of HTTP::Engine::Interface::FCGI

  # app_fastcgi.pl

  #!/usr/bin/perl
  use strict;
  use warnings;
  use App 'On::HTTP::Engine';

  App->init;
  App->http_engine(
    interface => {
      module => 'FCGI',
      args   => {
        leave_umask => 0,
        keep_stderr => 1,
        nointr      => 0,
        detach      => 0,
        manager     => 'FCGI::ProcManager',
        nproc       => 4,
        pidfile     => 'app.pid',
        listen      => 'localhost:8000',
      },
  )->run;

Squatting on top of HTTP::Engine::Interface::ModPerl

  # App/ModPerl.pm
  package App::ModPerl;
  use Moose;
  extends 'HTTP::Engine::Interface::ModPerl';
  use App 'On::HTTP::Engine';

  App->init;

  sub create_engine {
    my ($class, $r, $context_key) = @_;
    App->http_engine(interface => { module => 'ModPerl' });
  }

  1;

DESCRIPTION ^

This module makes it possible to run Squatting apps on top of HTTP::Engine.

API ^

An HTTP Abstraction Layer for Perl

App->http_engine(%options)

This method creates an HTTP::Engine object based on the %options that are given to it. The %options are passed directly to HTTP::Engine's new() method and Squatting-based request_handler is provided. After you get an HTTP::Engine object back, you can call run() on it to start up an HTTP server in most cases. The only time you don't do this is when you're using the ModPerl interface. See the "SYNOPSIS" for some examples.

SEE ALSO ^

Squatting, HTTP::Engine, Mojo

AUTHOR ^

John BEPPU <beppu@cpan.org>

COPYRIGHT ^

Copyright (c) 2008 John BEPPU <beppu@cpan.org>.

The "MIT" License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

syntax highlighting: