Last active
October 3, 2016 06:11
-
-
Save mailtoharshit/5726dc697c2ef1a0bdf5718d80c3f713 to your computer and use it in GitHub Desktop.
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 app = express(); | |
var path = require('path'); | |
//Env for Heroku (dyanmically adjusted) | |
var port = process.env.PORT || 8080; | |
// viewed at http://localhost:8080 | |
app.get('/', function(req, res) { | |
res.sendFile(path.join(__dirname + '/index.html')); | |
}); | |
//dynamically toggle to port | |
app.listen(port); | |
//log if server is on | |
console.log('Application loade successfully and hosted on' +port); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment