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"