Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deploy to heroku #609

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Conversation

hashlash
Copy link
Contributor

@hashlash hashlash commented Jun 30, 2022

This would allow users to easily deploy to Heroku.

Additionally, it also adds support for DB and Redis URL configuration, which is required for Heroku deployment

Copy link
Contributor Author

@hashlash hashlash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's some explanation of the code.

@@ -4,6 +4,7 @@ import redis from "redis";
import env from "./env";

const client = redis.createClient({
url: env.REDIS_URL,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The short-circuit syntax REDIS_URL || {} is not allowed with the @types/redis type definition.

       server/redis.ts(6,35): error TS2769: No overload matches this call.
         The last overload gave the following error.
           Argument of type 'string | { password: string; host: string; port: number; }' is not assignable to parameter of type 'ClientOpts'.
             Type 'string' has no properties in common with type 'ClientOpts'.

Comment on lines +24 to +39
"MAIL_HOST": {
"required": false,
"value": ""
},
"MAIL_PORT": {
"required": false,
"value": ""
},
"MAIL_USER": {
"required": false,
"value": ""
},
"MAIL_PASSWORD": {
"required": false,
"value": ""
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will allow users to manually verify the user using the method mentioned in #269 (comment)

Comment on lines +12 to +14
"PGSSLMODE": {
"value": "no-verify"
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed to connect to Heroku's Postgres without modifying the js code.

https://devcenter.heroku.com/articles/connecting-heroku-postgres#connecting-in-node-js

Comment on lines +9 to +11
"NPM_CONFIG_PRODUCTION": {
"value": "false"
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed for knex migrate to run properly.

https://stackoverflow.com/a/64679533/7168030

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant