Skip to content

Commit

Permalink
env added
Browse files Browse the repository at this point in the history
  • Loading branch information
darshanbajgain committed Oct 17, 2023
1 parent a417fe9 commit 6e4abac
Show file tree
Hide file tree
Showing 5 changed files with 3,189 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"dependencies": {
"markdown-it": "^13.0.2",
"markdown-parser-react": "^1.1.2",
"pg": "^8.11.3",
"pg-connection-string": "^2.6.2",
"prop-type": "^0.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
1 change: 1 addition & 0 deletions strapi/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,4 @@ exports
dist
build
.strapi-updater.json
package-lock.json
22 changes: 22 additions & 0 deletions strapi/config/env/production/database.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// path: ./config/env/production/database.js

const { parse } = require("pg-connection-string");

module.exports = ({ env }) => {
const { host, port, database, user, password } = parse(env("DATABASE_URL"));

return {
connection: {
client: 'postgres',
connection: {
host,
port,
database,
user,
password,
ssl: { rejectUnauthorized: false },
},
debug: false,
},
}
};
18 changes: 18 additions & 0 deletions strapi/config/env/production/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Path: ./config/env/production/server.js
// starting from Strapi v 4.6.1 server.js has to be the following

module.exports = ({ env }) => ({
proxy: true,
host: "0.0.0.0",
port: process.env.PORT,
url: env('MY_HEROKU_URL'),
app: {
keys: env.array('APP_KEYS')
},
admin: {
auth: {
secret: env('ADMIN_JWT_SECRET'),
},
},
})

Loading

0 comments on commit 6e4abac

Please sign in to comment.