我应该在生产Knex构建中指定什么主机以部署在heroku上?

时间:2018-07-20 21:47:11

标签: node.js postgresql heroku knex.js

我有一个如下所示的knexfile:

module.exports = {

  testing: {
    client: 'postgresql',
    connection: {
      database: 'poker_handsdb'
    },
    pool: {
      min:2,
      max: 10
    },
    migrations: {
      tableName: 'knex_migrations'
    }
  },

  development: {
    client: 'postgresql',
    connection: {
      database: 'poker_handsdb',
    },
    pool: {
      min: 2,
      max: 10
    },
    migrations: {
      tableName: 'knex_migrations'
    }
  }, 

  production: { 
    client: 'postgresql', 
    connection: {
      database: 'poker_handsdb',
    },
    pool: {
      min: 2,
      max: 10
   },
    migrations: {
      tableName: 'knex_migrations'
    }
  }
}; 

我将应用程序部署到了heroku,当我尝试运行knex migration:latest时,出现以下错误:  连接ECONNREFUSED 127.0.0.1:5432

要让生产版本在heroku上运行,我需要指定什么作为主机/数据库?我试图在heroku上运行本地托管的postgres实例是否有意义?

0 个答案:

没有答案