Created
July 11, 2013 18:06
-
-
Save alycda/5977738 to your computer and use it in GitHub Desktop.
Node.JS: initialize server. #sublime
This file contains hidden or 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'); | |
| var url = require('url'); | |
| var route = function(request, response){ | |
| var path = url.parse(request.url).pathname; | |
| response.writeHead(200, {'Content-Type': 'text/plain'}); | |
| response.end('Hello World.\n'); | |
| }; | |
| http.createServer(route).listen(8000); | |
| console.log('node.js Server running \'alyda\' at http://localhost:8000/'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment