Skip to content

Instantly share code, notes, and snippets.

@jin3lee
Created January 8, 2017 04:43
Show Gist options
  • Save jin3lee/7d67f70641c7d25faf9f303910867f7f to your computer and use it in GitHub Desktop.
Save jin3lee/7d67f70641c7d25faf9f303910867f7f to your computer and use it in GitHub Desktop.
what should be inside app.js for server to run by default
var express = require('express'); // require express module
var app = express(); // references and creates a new express app
var serv = require('http').Server(app); //require http module with express application info
app.get('/', function(req, res) {
res.sendFiles(__dirname + '/client/index.html');
});
app.use('/client', express.static(__dirname + '/client'));
serv.listen(2000);
console.log("Server started.");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment