| [reply] |
| [reply] |
# A single statement web server for static files and cgis too
io(":8080")
->accept("-fork")
->(
sub { $_[0] < io( -x $1 ? "./$1 |" : $1) if /^GET \/(.*) /
}
);
I'm not sure how well, or even if it works, but...it comes with a good pedigree.
Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algoritm, algorithm on the code side." - tachyon
| [reply] [d/l] |
Funny stuff! That won't work for CGIs though. It doesn't set up the CGI environment variables.
-sam
| [reply] |
Uh, that regexp can't be right. For one thing, the argument to GET is a URL and doesn't have to start with a slash; and there's usually an HTTP version string afterwards.
| [reply] |
The argument does start with a slash if your "server" is not working as a proxy, and the HTTP string comes after the space, which is also matched with the regex.
| [reply] |
What operating system? What is the language for the .exe? What does it have to be able to do? Is it just serve up webpages or does it have to handle CGI requests? What about images?
Also, what licensing requirements does your ".exe program" have? Depending, it might be able to use a number of off-the-shelf options.
------
We are the carpenters and bricklayers of the Information Age.
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose
I shouldn't have to say this, but any code, unless otherwise stated, is untested
| [reply] |