Simplify code for heroku

This commit is contained in:
bananaappletw 2016-12-22 19:42:00 +08:00
parent 936d922442
commit 3a091ff9a5

View file

@ -14,8 +14,9 @@ dbconfig.logging = config.debug ? logger.info : false;
var sequelize = null; var sequelize = null;
// Heroku specific
if (process.env.DATABASE_URL) if (process.env.DATABASE_URL)
sequelize = new Sequelize(process.env.DATABASE_URL, dbconfig.username, dbconfig.password, dbconfig); sequelize = new Sequelize(process.env.DATABASE_URL);
else else
sequelize = new Sequelize(dbconfig.database, dbconfig.username, dbconfig.password, dbconfig); sequelize = new Sequelize(dbconfig.database, dbconfig.username, dbconfig.password, dbconfig);