javascript - How to connect to Heroku Postgresql from Sails.js Java Script - Stack Overflow

js to create my application. I want to use Heroku database hosting where I created and got database. No

js to create my application. I want to use Heroku database hosting where I created and got database. Now i try to connect to it from my application. That's snippet from my local.js :

adapters: {

'default': 'postgres',
 module   : 'sails-postgresql',
 host     : '...',
 port     : 5432,
 user     : '...',
 password : '...',
 database : '...',

 schema: true //This makes sure that sails matches 
               //the database schema to your models.
}

When i lift the sails application i got error :

"Error creating a connection to Postgresql: error: no pg_hba_conf entry for host "83.21...", user ..., database ..., SSL off"

The "..." are user,databse etc from my local.js.

How to fix the problem? When I change the data in the local.js to my local postgresql database it works fine, but when I change the data and try to connect to the database on Heroku hosting it displays the error all time :/

js to create my application. I want to use Heroku database hosting where I created and got database. Now i try to connect to it from my application. That's snippet from my local.js :

adapters: {

'default': 'postgres',
 module   : 'sails-postgresql',
 host     : '...',
 port     : 5432,
 user     : '...',
 password : '...',
 database : '...',

 schema: true //This makes sure that sails matches 
               //the database schema to your models.
}

When i lift the sails application i got error :

"Error creating a connection to Postgresql: error: no pg_hba_conf entry for host "83.21...", user ..., database ..., SSL off"

The "..." are user,databse etc from my local.js.

How to fix the problem? When I change the data in the local.js to my local postgresql database it works fine, but when I change the data and try to connect to the database on Heroku hosting it displays the error all time :/

Share Improve this question edited Mar 4, 2014 at 17:00 CSharpBeginner asked Mar 4, 2014 at 15:32 CSharpBeginnerCSharpBeginner 1,7256 gold badges24 silver badges39 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

Heroku requires the ssl setting to be turned on. Add ssl: true to your config like so:

module   : 'sails-postgresql',
host     : '...',
port     : 5432,
user     : '...',
password : '...',
database : '...',
ssl      : true

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744424472a4573543.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信