This repository has been archived by the owner on May 27, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f78d18
commit 0e94a3c
Showing
74 changed files
with
16,713 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
var cgi = require('cgi') | ||
this.onstaticfile = function (event) { | ||
|
||
var | ||
p = event.polpetta, | ||
req = event.request, | ||
res = event.response, | ||
ext = event.ext.toLowerCase(), | ||
fs = require('fs'), | ||
path = require('path'), | ||
stat = fs.statSync(event.file); | ||
|
||
|
||
if(parseInt(stat.mode.toString(8)[0], 10) & 1){ | ||
var exec = cgi(event.file, {cwd : path.dirname(event.file)}) | ||
exec(req, res) | ||
event.preventDefault() | ||
} | ||
|
||
} | ||
|
||
/// for debug purpose | ||
function log(e) { | ||
console.log(e); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env perl | ||
|
||
|
||
print "Content-type:text/html\r\n\r\n"; | ||
print '<html>'; | ||
print '<head>'; | ||
print '<title>Polpetta support for proper CGI</title>'; | ||
print '</head>'; | ||
print '<body>'; | ||
print '<h2>Hello Word! This is my first CGI program</h2>'; | ||
|
||
print '<div>'; | ||
print $ENV{'QUERY_STRING'}; | ||
print '</div>'; | ||
print '<a href="?foo=bar&baz=bak">try with some parameters</a>'; | ||
print '</body>'; | ||
print '</html>'; | ||
|
||
1; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.