Skip to content

Instantly share code, notes, and snippets.

@adparadise
Created November 2, 2012 22:53
Show Gist options
  • Save adparadise/4004850 to your computer and use it in GitHub Desktop.
Save adparadise/4004850 to your computer and use it in GitHub Desktop.
Proxy server, local fileserve refactoring
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