Created
March 23, 2015 19:47
-
-
Save johnvilsack/d401a52c6671c2450985 to your computer and use it in GitHub Desktop.
This file contains 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
// Use the package, HTTP. | |
var http = require('http'); | |
// In the package HTTP, execute createServer | |
http.createServer(function (req, res) { | |
// When createServer sees a request, shoot a header with a status 200 (this means OK) and tell it the next bit is text/plain | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
// This is the bits that go to the browser | |
res.end('Hello World\n'); | |
}) | |
//This tells http.createServer() to listen on port 1337, on address 127.0.0.1 | |
.listen(1337, '127.0.0.1'); | |
console.log('Server running at http://127.0.0.1:1337/'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment