-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
15 additions
and
13 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TIMES=2 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
web: node server.js | ||
web: node --debug=5858 server.js |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
var express = require("express"); | ||
var express = require('express'); | ||
var app = express(); | ||
var path = require("path"); | ||
var publicPath = __dirname + "/dist/"; | ||
|
||
app.get("/", function(req, res) { | ||
res.sendFile(path.join(__dirname + "/dist/index.html")); | ||
}); | ||
app.set('port', (process.env.PORT || 5000)); | ||
|
||
app.use(express.static(__dirname + '/dist')); | ||
|
||
app.use("/", express.static(publicPath)); | ||
|
||
app.listen(process.env.PORT || 3000, function() { | ||
/* eslint-disable no-console */ | ||
console.log("Listening on port " + process.env.PORT || 3000); | ||
/* eslint-enable no-console */ | ||
app.get('/', function(request, response) { | ||
response.render('dist/index'); | ||
}); | ||
|
||
app.listen(app.get('port'), function() { | ||
console.log('Node app is running on port', app.get('port')); | ||
}); |