Skip to content

Commit

Permalink
added debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
somnathbm committed Nov 24, 2024
1 parent 9f3143d commit 89d7b25
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package db
import (
"context"
"errors"
"fmt"
"os"
"time"

Expand All @@ -25,13 +26,18 @@ func get_db_collection() (*mongo.Collection, *mongo.Client) {
"APP_DB_NAME": os.Getenv("APP_DB_NAME"),
"COLLECTION_NAME": os.Getenv("COLLECTION_NAME"),
}
fmt.Println("base64 encoded data from ENV")
fmt.Println(os.Getenv("APP_DB_URI"))

base64_decoded_data, base64_err := utils.DecodeBase64(base64_encoded_data)
if base64_err != nil {
// fmt.Println("base64 decode error", base64_err.Error())
}

client, err := mongo.Connect(options.Client().ApplyURI(base64_decoded_data["APP_DB_URI"]))
// fmt.Println("base64 decoded data")
fmt.Println(base64_decoded_data["APP_DB_URI"])

client, err := mongo.Connect(options.Client().ApplyURI(os.Getenv("APP_DB_URI")))
if err != nil {
panic(err)
}
Expand Down
1 change: 0 additions & 1 deletion src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package main

import (
"hms_patient_mgmt_svc/api"
// "github.com/joho/godotenv"
)

func main() {
Expand Down

0 comments on commit 89d7b25

Please sign in to comment.