【发布时间】:2019-11-01 18:13:19
【问题描述】:
这是我第一次使用 NestJS,我无法将托管在 Digitalocean 上的 Postgres 数据库连接到 NestJS。
我在网上搜索了解决方案并尝试添加"ssl": "true" or "extra": { "ssl": "true" }
这是我的 ormconfig.json
{
"type": "postgres",
"host": "host",
"port": "port",
"username": "username",
"password": "password",
"database": "database",
"extra": {
"ssl": "true"
},
"synchronize": "true",
"logging": "true",
"entities": ["src/**/*.entity.ts", "dist/**/*.entity.js"]
}
我希望它连接到服务器。我得到的错误是[TypeOrmModule] Unable to connect to the database. error: no pg_hba.conf entry for host "", user "", database "", SSL off
【问题讨论】:
标签: postgresql ssl nestjs typeorm