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

Take entire connection URL from an env var #1

Open
Emersont1 opened this issue Jul 9, 2021 · 0 comments
Open

Take entire connection URL from an env var #1

Emersont1 opened this issue Jul 9, 2021 · 0 comments

Comments

@Emersont1
Copy link

Emersont1 commented Jul 9, 2021

voting/common/common.go

Lines 23 to 30 in 32be358

var (
username = os.Getenv("MONGO_USER")
password = os.Getenv("MONGO_PASS")
)
opts := options.Client().ApplyURI(fmt.Sprintf("mongodb+srv://%s:%[email protected]/hacksoc?retryWrites=true&w=majority", username, password))
log.Println("connecting to mongodb database...")

Currently, It's tied to the server, we can't use anything other that that mongodb atlas instance (i.e) we can't swap to a local version of mongodb if we want/need to

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

No branches or pull requests

1 participant