Skip to content

Instantly share code, notes, and snippets.

@jamesxv7
Created March 14, 2017 18:56
Show Gist options
  • Save jamesxv7/eee06ea172de23db3b3ccd406b1a0bb3 to your computer and use it in GitHub Desktop.
Save jamesxv7/eee06ea172de23db3b3ccd406b1a0bb3 to your computer and use it in GitHub Desktop.
const http = require('http')
const port = 3000
const requestHandler = (request, response) => {
console.log(request.url)
response.end('Hello Node.js Server!')
}
const server = http.createServer(requestHandler)
server.listen(port, (err) => {
if (err) {
return console.log('Something bad happened', err)
}
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