in reply to setting server root HTTP::SERVER::Simple

The module HTTP::Server::Simple::Static provides just that, a way to serve static files from within HTTP::Server::Simple. The documentation is pretty good too.

  • Comment on Re: setting server root HTTP::SERVER::Simple

Replies are listed 'Best First'.
Re^2: setting server root HTTP::SERVER::Simple
by blueberryCoffee (Scribe) on Oct 09, 2006 at 18:37 UTC
    bless you, that is just what I needed. I now have this working
    sub handle_request { my ($self, $cgi) = @_; # is this an static request or dynamic # actions do not have a period as they are # functions of the webserver rather than files if($cgi->path_info() =~ /\./) { $self->serve_static($cgi,"c:\\appdir\\html"); } else { # ensure action exists or set it to default my $action = $cgi->path_info(); $action =~ s|^/||; if(! $self->can($action)) { $action = "home"; } $self->$action($cgi); } }
    Having dynamic requestes be functions of the web server is probably not the best way to go about this, but it is working. Not sure what the best way of doing it is.