Skip to content

Take entire connection URL from an env var #1

Open
@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:%[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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions