Skip to content

Instantly share code, notes, and snippets.

@yanhua365
Created December 12, 2013 13:03
Show Gist options
  • Save yanhua365/7927627 to your computer and use it in GitHub Desktop.
Save yanhua365/7927627 to your computer and use it in GitHub Desktop.
简单的nodejs的HTTP Server
var http = require("http"), sys = require('sys');
http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Welcome to Node.js!");
response.end();
}).listen(6600);
sys.puts('Server running at http://127.0.0.1:8006/');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment