Skip to content

Commit

Permalink
Setup start script and heroku port
Browse files Browse the repository at this point in the history
  • Loading branch information
zozoit committed Sep 24, 2018
1 parent 32c8264 commit e265134
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"author": "",
"license": "ISC",
Expand Down
5 changes: 3 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const express = require('express');
const hbs = require('hbs');
const fs = require('fs');

const port = process.env.PORT || 3000;
const app = express();

hbs.registerPartials(__dirname + '/views/partials');
Expand Down Expand Up @@ -59,6 +60,6 @@ app.get('/bad', (req, res) => {
)
})

app.listen(3000, () => {
console.log('Server is up on port 3000');
app.listen(port, () => {
console.log('Server is up on port ' + port);
});

0 comments on commit e265134

Please sign in to comment.