Skip to content

Instantly share code, notes, and snippets.

@bruno78
Created October 24, 2016 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bruno78/58cde2bbdffa9d8accf7eb6ad51d4c28 to your computer and use it in GitHub Desktop.
Save bruno78/58cde2bbdffa9d8accf7eb6ad51d4c28 to your computer and use it in GitHub Desktop.
Creating a simple server using Node.js and Express
var express = require('express');
var morgan = require('morgan');
var hostname = 'localhost';
var port = 3000;
var app = express();
app.use(morgan('dev'));
// Start server by listening
server.listen(port, hostname, function(){
console.log('Server running at http://${hostname}:${localhost}/');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment