Created
October 24, 2016 21:50
-
-
Save bruno78/58cde2bbdffa9d8accf7eb6ad51d4c28 to your computer and use it in GitHub Desktop.
Creating a simple server using Node.js and Express
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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