Skip to content

Commit

Permalink
chore: heroku init
Browse files Browse the repository at this point in the history
  • Loading branch information
JHIH-LEI committed Jul 25, 2021
1 parent f118e90 commit 507e5dc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: node app.js
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const cookieParser = require('cookie-parser')
const flash = require('connect-flash')

require('./config/mongoose')
const port = 3000
const port = process.env.port || 3000

app.engine('handlebars', exphbs({ defaultLayout: 'main' }))
app.set('view engine', 'handlebars')
Expand Down
3 changes: 2 additions & 1 deletion config/mongoose.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const mongoose = require('mongoose')
mongoose.connect('mongodb://localhost/expense-tracker', { useNewUrlParser: true, useUnifiedTopology: true })
const MONGODB_URI = process.env.MONGODB_URI || 'mongodb://localhost/expense-tracker'
mongoose.connect(MONGODB_URI, { useNewUrlParser: true, useUnifiedTopology: true })
const db = mongoose.connection

db.on('error', () => console.log('mongodb error!'))
Expand Down

0 comments on commit 507e5dc

Please sign in to comment.