If on a UNIX/Linux platform make sure to chmod +x SimpleHTTPServer.pl#!/usr/bin/env perl use HTTP::Daemon; my $port = $ARGV[0] || 8000; my $d = HTTP::Daemon->new(LocalPort => $port) or die $!; print "SimpleHTTPServer.pl listening at: ", $d->url, "\n"; while (my $c = $d->accept) { while (my $r = $c->get_request) { $c->send_file_response(".".$r->url->path); } }
The implementation (a perl script) is not a one liner, but the execution (calling the perl script) is...
In reply to Re^4: Simple http server one-liner for some static files?
by bcarroll
in thread Simple http server one-liner for some static files?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |