Skip to content

Instantly share code, notes, and snippets.

Last active March 19, 2017 05:02
What would you like to do?
Technical questions
What is the difference between "express": "^4.13.3" and "express": "~4.13.3" ?
What happens if I use `npm install <package> --save` instead of `npm install <package> --save-dev` ?
var http = require('http');
var hostname = 'localhost';
var port = 3000;
var server = http.createServer( function(req, res) {
console.log( req.headers);
res.writeHead( 200, { 'Content-Type': 'text/html' });
res.end( '<html><body><h1>Hello World</h1></body></html>');
server.listen( port, hostname, function() {
/* TQ: what will each of these lines yield as output? */
console.log( `Server running at http://${hostname}:${port}/`);
console.log( 'Server running at http://${hostname}:${port}/');
console.log( "Server running at http://${hostname}:${port}/");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment