Created
June 24, 2012 15:33
-
-
Save TeeTeeHaa/2983697 to your computer and use it in GitHub Desktop.
example for issue in node-static 0.5.9
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
function onload() | |
{ | |
// Firefox | |
document.getElementById("test").textContent = "good :)"; | |
// Internet Explorer | |
document.getElementById("test").innerText = "good :)"; | |
} |
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
files must be located within the following directory layout: | |
. | |
| server.js | |
\---public | |
\---path | |
code.js | |
index.html |
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
<html> | |
<head> | |
<title>node-static 0.5.9 bug</title> | |
<script type="text/javascript" src="code.js"></script> | |
</head> | |
<body onload="onload();"> | |
<div id="test">bad :(</div> | |
</body> | |
</html> |
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
var static = require('node-static'); | |
var file = new(static.Server)('./public'); | |
require('http').createServer(function (request, response) { | |
request.addListener('end', function () { | |
file.serve(request, response); | |
}); | |
}).listen(80); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment