Skip to content

Instantly share code, notes, and snippets.

@hidek
Created May 31, 2012 03:55
Show Gist options
  • Save hidek/2840847 to your computer and use it in GitHub Desktop.
Save hidek/2840847 to your computer and use it in GitHub Desktop.
--- web/server.js.orig 2012-05-31 12:50:45.000000000 +0900
+++ web/server.js 2012-05-31 12:51:12.000000000 +0900
@@ -51,7 +51,8 @@
}
function serveFile(response, uri, filename) {
- path.exists(filename, function(exists) {
+ var exists = fs.exists || path.exists;
+ exists(filename, function(exists) {
if(!exists) {
finish(response, uri, 404, "text/plain", "404 Not Found\n");
return;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment