Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
const http = require('http');
const port = 8000;
const url = require('url');
const requestHandler = (request, response) => {
const parsedUrl = url.parse(request.url, true);
if( &&{
response.end(`Hello, ${} from ${}`);
response.end("Please provide name AND city parameters");
const server = http.createServer(requestHandler);
server.listen(port, (err) =>{
console.error("Something bad happened");
console.log(`server is listening on ${port}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment