Skip to content

Instantly share code, notes, and snippets.

@yomotsu
Created October 3, 2015 04:44
Show Gist options
  • Save yomotsu/d5db84f9771f85c0b8d2 to your computer and use it in GitHub Desktop.
Save yomotsu/d5db84f9771f85c0b8d2 to your computer and use it in GitHub Desktop.
hello world in node.js
// app.js
var http = require( 'http' );
var port = process.env.PORT || 3000;
http.createServer( function( req, res ) {
res.writeHead( 200, { 'Content-Type': 'text/plain' } );
res.end( 'Hello World\n' );
} ).listen( port );
// $ node app.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment