Created
November 26, 2015 00:17
-
-
Save MehulATL/647f7f26ae8fcac2bac5 to your computer and use it in GitHub Desktop.
simple express server
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
// Server | |
var express = require('express'); | |
var app = express(); | |
// Store all environment variables | |
app.set('port', process.env.PORT || 3001); | |
app.set('env', process.env.NODE_ENV || 'production'); | |
// App middleware | |
// serve index.html at this path | |
app.use(express.static(__dirname + '/client')); | |
app.listen(app.get('port'), function(){ | |
console.log('Please go to localhost:' + app.get('port') + ' in your web browser.'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment