Skip to content

Commit eda7c65

Browse files
committed
fixed database url
1 parent 687c341 commit eda7c65

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
"main": "index.js",
66
"scripts": {
77
"start": "node src/server.js",
8-
"predeploy": "npm audit",
8+
"predeploy": "npm audit && npm run migrate-production",
99
"deploy": "git push heroku master",
1010
"test": "mocha --require test/setup.js",
1111
"migrate": "postgrator --config postgrator-config.js",
12+
"migrate-production": "postgrator --config postgrator-production-config.js",
1213
"dev": "nodemon src/server.js"
1314
},
1415
"keywords": [],

postgrator-production-config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
require('dotenv').config();
2+
3+
module.exports = {
4+
"migrationDirectory": "migrations",
5+
"driver": "pg",
6+
"host": process.env.PROD_MIGRATION_DB_HOST,
7+
"port": process.env.PROD_MIGRATION_DB_PORT,
8+
"database": process.env.PROD_MIGRATION_DB_NAME,
9+
"username": process.env.PROD_MIGRATION_DB_USER,
10+
"password": process.env.PROD_MIGRATION_DB_PASS,
11+
"ssl": true
12+
}

src/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ module.exports = {
77
CLIENT_SECRET: process.env.CLIENT_SECRET,
88

99
CLIENT_ORIGIN: process.env.CLIENT_ORIGIN || 'http://localhost:3000',
10-
DB_URL: process.env.DB_URL || 'postgresql://tunechainer@localhost/saved_playlists'
10+
DB_URL: process.env.DATABASE_URL || 'postgresql://tunechainer@localhost/saved_playlists'
1111

1212
};

0 commit comments

Comments
 (0)