Skip to content

Instantly share code, notes, and snippets.

@chriswebb09
Created May 11, 2017 10:03
Show Gist options
  • Save chriswebb09/c7e93c4b6adbdd7dbb87c70fcc4970dc to your computer and use it in GitHub Desktop.
Save chriswebb09/c7e93c4b6adbdd7dbb87c70fcc4970dc to your computer and use it in GitHub Desktop.
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