Created
May 11, 2017 10:03
-
-
Save chriswebb09/c7e93c4b6adbdd7dbb87c70fcc4970dc to your computer and use it in GitHub Desktop.
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
switch(url.parse(request.url).pathname) { | |
case '/p1': | |
if (!error) { | |
response.end(data); | |
} else { | |
console.log(error); | |
} | |
case '/p2': | |
if (!error) { | |
response.end("Page 2"); | |
} else { | |
console.log(error); | |
} | |
default: | |
response.end("Default") | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment