Read mongodb path from env
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
9bb6c12ef9
commit
3e5bf1d23d
|
@ -17,8 +17,8 @@ func main() {
|
|||
}
|
||||
|
||||
func initializeRoutes(r *gin.Engine) {
|
||||
r.POST("/data", src.CreateData)
|
||||
r.PUT("/data/:id", src.CreateEnvironmentData)
|
||||
//r.POST("/data", src.CreateData)
|
||||
//r.PUT("/data/:id", src.CreateEnvironmentData)
|
||||
r.Use(src.AEADHandler)
|
||||
{
|
||||
r.PUT("/data/authed/:id", src.CreateEnvironmentData)
|
||||
|
|
|
@ -13,7 +13,6 @@ import (
|
|||
"golang.org/x/crypto/blake2s"
|
||||
)
|
||||
|
||||
const uri = "mongodb://192.168.0.159:27017"
|
||||
const salt = "ENVIRONMENT"
|
||||
|
||||
var dbCollection *mongo.Collection
|
||||
|
@ -70,3 +69,14 @@ func DbDisconnect() {
|
|||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func getMongoURI() string {
|
||||
dbPath := os.Getenv("GIN_DB_PATH")
|
||||
|
||||
if dbPath == "" {
|
||||
dbPath = "mongodb://192.168.0.159:27017"
|
||||
}
|
||||
|
||||
return dbPath
|
||||
}
|
||||
|
|
|
@ -8,7 +8,8 @@ services:
|
|||
|
||||
apiserver:
|
||||
image: registry.jacknet.io/51m0n/environment-api:latest
|
||||
|
||||
environment:
|
||||
- GIN_DB_PATH=mongodb://database:27017
|
||||
proxy:
|
||||
image: nginx:latest
|
||||
|
||||
|
|
Loading…
Reference in New Issue