Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
[jfsiii@web165 node_flot]$ cat index.js
var http = require('http'), ip = "", port = 41205;
http.createServer(function (req, res)
console.log('request received');
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('NodeJS on!\n');
console.log('Server running at http://'+ip+':'+port+'/');
[jfsiii@web165 node_flot]$ node index.js &
[1] 27161
[jfsiii@web165 node_flot]$ Server running at
[jfsiii@web165 node_flot]$ curl -i ''
curl: (7) couldn't connect to host
[jfsiii@web165 node_flot]$ curl -i ''
HTTP/1.1 200 OK
Server: nginx
Date: Sun, 21 Nov 2010 14:15:46 GMT
Content-Type: text/html
Connection: keep-alive
Last-Modified: Sun, 21 Nov 2010 00:19:39 GMT
ETag: "e90617-c-4958518605cc0"
Accept-Ranges: bytes
Content-Length: 12
Hello, world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment