Created
November 2, 2012 22:53
-
-
Save adparadise/4004850 to your computer and use it in GitHub Desktop.
Proxy server, local fileserve refactoring
This file contains hidden or 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 localFiles = { | |
"/js/working.js": "local/working.js" | |
}; | |
function server (httpRequest, httpResponse) { | |
var filename = localFiles[httpRequest.url]; | |
if (filename) { | |
serveLocalFile(httpRequest, httpResponse, filename); | |
} else { | |
serveViaProxy(httpRequest, httpResponse); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment