Created
January 8, 2017 04:43
-
-
Save jin3lee/7d67f70641c7d25faf9f303910867f7f to your computer and use it in GitHub Desktop.
what should be inside app.js for server to run by default
This file contains hidden or 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'); // 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