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
CGI::Application::Dispatch::Server(3) User Contributed Perl Documentation CGI::Application::Dispatch::Server(3)

CGI::Application::Dispatch::Server - A simple HTTP server for developing with CGI::Application::Dispatch

This module is no longer maintained or recommended. Use CGI::Application::Server instead, which can do all this can and more.

  use CGI::Application::Dispatch::Server;

  my $server = CGI::Application::Dispatch::Server->new( 
             class    => 'MyClass::Dispatch' 
             root_dir => '/home/project/www',
   );
  $server->run;

This is a simple HTTP server for for use during development with CGI::Application::Dispatch.

It's a helpful tool for working on a private copy of a website on a personal computer. It's especially useful for working offline when you don't have easy access to a full-blown webserver.

If you have customized dispatch args, it's recommended that you put them in their own class, as described in the CGI::Application::Dispatch docs. That way, they can be accessed directly through CGI::Application::Dispatch, or through here.

  my $server = CGI::Application::Dispatch::Server->new( 
        port     => '80',                # optional, defaults to 8080
        class    => 'MyClass::Dispatch', # optional, defaults CGI::Application::Dispatch
        root_dir => './alphasite',       # optional, defaults to "."
  );

Initialize the server. If you've subclassed CGI::Application::Dispatch to provide your own "dispatch_args()", let us know that here.

If you are also serving some static content, define "root_dir" with the root directory of this content.

 $server->dispatch_args(\%override_args);

This accepts a hashref of arguments and merges it into CGI::Application::Dispatch's dispatch() arguments.

Be aware that this is a shallow merge, so a top level key name in the new hash will completely replace one in the old hash with the same name.

It is recommended that you put your dispatch args in a separate class instead, as mentioned in the DESCRIPTION.

  $self->handle_request($cgi);

This will check the request URI and handle it appropriately, printing to STDOUT upon success. There's generally no reason to call this directly.

This is a subclass of HTTP::Server::Simple and all of its caveats apply here as well.

If you are not sure the behavior is a bug, please discuss it on the cgiapp mailing list ( cgiapp@lists.erlbaum.net ). If you feel certain if you have found a bug, please report it through rt.cpan.org.

This module was cloned from CGI::Application::Server, which in turn borrowed significant parts from HTTP::Request::AsCGI.

George Hartzell <hartzell@alerce.com> Mark Stosberg

Copyright 2006 by George Hartzell

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

2010-01-02 perl v5.32.1

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

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