GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  HTTP::ENGINE::COOKBOOK (3)

.ds Aq ’

NAME

HTTP::Engine::Cookbook - How to cook a HTTP::Engine

CONTENTS

DESCRIPTION

    Deployments

The biggest advantage of using HTTP::Engine is to have one single request handler routine for your application:



    package MyApp;
    use HTTP::Engine::Response;

    sub handle_request {
        my ($request) = @_;
        # ...
        HTTP::Engine::Response->new( body => "Hello World" );
    }



When it comes to deployment, you’ll need to write additional handlers or modules based on different server environments.

Deploy your application as a CGI script.

The very basic and simple approach is to deploy your application as a CGI script. To do this, you need to write a CGI program like this:



    ## myapp.cgi
    #!/usr/bin/perl

    use MyApp;
    use HTTP::Engine;
    my $engine = HTTP::Engine->new(
        interface => {
            module => CGI,
            request_handler => \&MyApp::handle_request
        }
    );
    $engine->run;



This CGI program can then be placed under the conventional cgi-bin/ directory as those defined in your server configuration.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 HTTP::ENGINE::COOKBOOK (3) 2011-10-04

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.