From aae817d9c1cf14897042c81e68f6e463ede7020c Mon Sep 17 00:00:00 2001 From: ediazjz Date: Thu, 23 Jun 2022 00:01:52 -0500 Subject: [PATCH] ci: initial Heroku deploy --- config/env/production/database.js | 19 +++++++++++++++++++ config/env/production/server.js | 7 +++++++ package.json | 4 +++- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 config/env/production/database.js create mode 100644 config/env/production/server.js diff --git a/config/env/production/database.js b/config/env/production/database.js new file mode 100644 index 0000000..8c41828 --- /dev/null +++ b/config/env/production/database.js @@ -0,0 +1,19 @@ +const parse = require('pg-connection-string').parse; +const config = parse(process.env.DATABASE_URL); + +module.exports = ({ env }) => ({ + connection: { + client: 'postgres', + connection: { + host: config.host, + port: config.port, + database: config.database, + user: config.user, + password: config.password, + ssl: { + rejectUnauthorized: false + }, + }, + debug: false, + }, +}); diff --git a/config/env/production/server.js b/config/env/production/server.js new file mode 100644 index 0000000..2c00811 --- /dev/null +++ b/config/env/production/server.js @@ -0,0 +1,7 @@ +module.exports = ({ env }) => ({ + proxy: true, + url: env('MY_HEROKU_URL'), + app: { + keys: env.array('APP_KEYS') + }, +}) diff --git a/package.json b/package.json index 76550f4..5a71cc2 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,9 @@ "@strapi/plugin-users-permissions": "4.2.0", "@strapi/provider-upload-cloudinary": "^4.2.0", "@strapi/strapi": "4.2.0", - "better-sqlite3": "7.4.6" + "better-sqlite3": "7.4.6", + "pg": "^8.7.3", + "pg-connection-string": "^2.5.0" }, "author": { "name": "A Strapi developer"