Skip to content

Commit

Permalink
Add check for credentials file
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-nguyen committed Jun 28, 2018
1 parent 6a6036b commit d6b1277
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package database
import (
"context"
"log"
"os"

"github.com/ubclaunchpad/bumper/server/models"

Expand All @@ -22,6 +23,11 @@ var DBC *db.Client

// ConnectDB connects the DB handle to firebase db.
func ConnectDB(credentialsPath string) {
if _, err := os.Stat(credentialsPath); os.IsNotExist(err) {
log.Println("Firebase credentials not found")
return
}

// Initialize default DB App
opt := option.WithCredentialsFile(credentialsPath)

Expand Down

0 comments on commit d6b1277

Please sign in to comment.