Skip to content

Instantly share code, notes, and snippets.

@ni8mr
Last active November 9, 2016 08:15
Show Gist options
  • Save ni8mr/97ffbe54f7ff43fff42bb7372044a99e to your computer and use it in GitHub Desktop.
Save ni8mr/97ffbe54f7ff43fff42bb7372044a99e to your computer and use it in GitHub Desktop.
// Initial "Hello world" app using NodeJS
var http = require('http');
http.createServer(function(req, res){
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(8080, 'localhost');
// Initial "Hello world" app using express.js
var express = require('express')
var app = express()
app.get('/', function(req, res){
res.send('Hello World!')
})
app.listen(3000, function(){
console.log('Example app listening on port 3000!')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment