Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: Serving Static Content using Plack

by Anonymous Monk
on Jan 29, 2012 at 05:24 UTC ( [id://950546]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Serving Static Content using Plack
in thread Serving Static Content using Plack

Maybe you'd like to share what you tried?

I call this server "apacheet"

#!/usr/bin/perl -- use strict; use warnings; use Plack::Builder; use Plack::Runner; use Plack::App::Directory; use Plack::App::CGIBin; my $app = builder { mount "/" => Plack::App::Directory->new({ root => 'path/to/public_html', })->to_app; mount "/cgi-bin" => Plack::App::CGIBin->new({ root => 'path/to/cgi-bin', })->to_app; }; #~ $app = builder { #~ enable 'Debug' => panels => [ qw(DBITrace Timer) ]; #~ $app; #~ }; my $runner = Plack::Runner->new; $runner->parse_options( qw' --host 127.0.0.1 --port 80 '); $runner->run($app);

See also

http://www.modernperlbooks.com/mt/2011/08/serving-a-local-directory-with-plack.html

http://advent.plackperl.org/2009/12/day-5-run-a-static-file-web-server-with-plack.html]

http://learn.perl.org/examples/static_server.html

https://metacpan.org/module/Plack::App::File::Range

http://advent.plackperl.org/2009/12/day-17-serving-static-files-from-your-application.html

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://950546]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-25 09:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found