admin管理员组文章数量:1379411
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 badges1 Answer
Reset to default 8Heroku 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
本文标签: javascriptHow to connect to Heroku Postgresql from Sailsjs Java ScriptStack Overflow
版权声明:本文标题:javascript - How to connect to Heroku Postgresql from Sails.js Java Script - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744424471a2605618.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论