Created
November 12, 2014 16:22
-
-
Save wardbell/21bf82fe97c5095834b3 to your computer and use it in GitHub Desktop.
Simplest Node Server In The Universe
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
var http = require('http'); | |
http.createServer(function (req, res) { | |
console.log('Got a request: '+req.method+' '+req.url); | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('Hello World\n'); | |
}) | |
.listen(1337, 'localhost'); // 127.0.0.1 | |
console.log('Server running at http://localhost:1337/'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment