Skip to content

Take entire connection URL from an env var #1

@Emersont1

Description

@Emersont1

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:%s@cluster0.q5uor.mongodb.net/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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions