Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Simple http server one-liner for some static files?

by Your Mother (Bishop)
on Oct 13, 2010 at 20:22 UTC ( #865152=note: print w/replies, xml ) Need Help??


in reply to Simple http server one-liner for some static files?

There are probably 5 ways to do that. Here's one that supports executables too:

A Tiny Web Server - Here is how you could write a simplistic web server that works with static and dynamic pages (IO::All):
perl -MIO::All -e 'io(":8080")->fork->accept->(sub { $_[0] < io(-x $1 ? "./$1 |" : $1) if /^GET \/(.*) / })'

Only recommended for personal use.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2019-08-22 06:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?