Skip to content

Instantly share code, notes, and snippets.

@naupaw
Created August 26, 2013 07:39
Show Gist options
  • Select an option

  • Save naupaw/6338902 to your computer and use it in GitHub Desktop.

Select an option

Save naupaw/6338902 to your computer and use it in GitHub Desktop.
var http = require('http'),
port = 3400;
http.createServer(function(req, res)
{
var body = "<pre>Haruskah belajar Node.js?</pre><p><h3>...Yo Kudu! :D</h3></p>";
res.writeHead(200, {
'Content-Length':Buffer.byteLength(body),
'Content-Type':'text/html',
'Pesan-Header':'Pengenalan Node.js'
});
res.write(body);
res.end();
}).listen(port);
console.log("Port " + port + " : Node.js Server...");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment