Added cgi

This commit is contained in:
anon
2024-03-10 15:57:35 +01:00
parent 787453b885
commit 00843ff8b6
3 changed files with 21 additions and 0 deletions

1
cgi/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.cgi

12
cgi/lighttpd.conf Normal file
View File

@ -0,0 +1,12 @@
server.document-root = var.CWD
server.port = "8083"
server.modules += ( "mod_cgi" )
cgi.assign = (
".cgi" => "",
)
server.modules += ( "mod_rewrite" )
url.rewrite-if-not-file = (
"^/$" => "/main.cgi"
)

8
cgi/main.cpp Normal file
View File

@ -0,0 +1,8 @@
// @BAKE g++ $@ -o $*.cgi
#include <stdio.h>
signed main(int argc, char * * argv, char * * envp) {
fputs("Content-Type: text/plain\r\n\r\n", stdout);
fputs("hello world", stdout);
return 0;
}