我不断收到此错误:
Error: self signed certificate
在终端中运行此命令时:
knex migrate:latest --env production
Run Code Online (Sandbox Code Playgroud)
我的 knexfile.js
require('dotenv').config();
module.exports = {
development: {
client: "pg",
connection: {
host: "localhost",
database: "my-movies"
}
},
production: {
client: "pg",
connection: process.env.DATABASE_URL
}
};
Run Code Online (Sandbox Code Playgroud)
我的 .env 文件:
DATABASE_URL=<my_database_url>?ssl=true
Run Code Online (Sandbox Code Playgroud)
Heroku 应用信息:
Addons: heroku-postgresql:hobby-dev
Auto Cert Mgmt: false
Dynos:
Git URL: https://git.heroku.com/path-name.git
Owner: xxxxxxxxx@xxxx.com
Region: us
Repo Size: 0 B
Slug Size: 0 B
Stack: heroku-18
Web URL: https://my-appname.herokuapp.com/
Run Code Online (Sandbox Code Playgroud)
我试过在 ssl: true 的 knexfile 的生产中放置一个键值对,但我得到了同样的错误。我过去已经这样做过很多次了,从来没有遇到过这个问题。想知道 Heroku 是否改变了任何东西,但在搜索他们的文档时我找不到任何东西。