-
-
Notifications
You must be signed in to change notification settings - Fork 15
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 config examples #12
Conversation
if (process.env.DATABASE_URL) { | ||
const url = require('url'); | ||
|
||
// Extract the connection information from the Heroku environment variable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I generally prefer low-level demonstrations like this (for clarity) but given that connection strings can be pretty wild, do you think it'd make sense to link to pg-connection-string
directly for the "official" example?
Could also mention that pg
users/drivers can define a connectionString
directly, skipping the need to manually parse: https://node-postgres.com/features/connecting#connection-uri
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, switched to pg-connection-string
.
I was thinking of also including a comment about pg
, but I think that will muddle this specific example, because then it will be about using module.exports
again... what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meh, I think this is fine. Users of pg
should be able to find the connectionString
option on their own. But even if they don't, this configuration works across the board.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Awesome, glad to help - thanks for the merge! |
Hi @lukeed 👋
Since these are kind of common use cases, I thought I would surface these config examples in the readme - what do you think?