Added measurements, and devices statsh
Added stats endpoints
This commit is contained in:
@@ -18,13 +18,18 @@ func Init() error {
|
||||
// port := config.AppConfig.Database.Port
|
||||
dbName := config.AppConfig.Database.DatabaseName
|
||||
password := config.AppConfig.Database.Password
|
||||
|
||||
|
||||
dbString := fmt.Sprintf("host=%s user=%s dbname=%s sslmode=disable password=%s", host, user, dbName, password)
|
||||
// db, err = gorm.Open("postgres", "host=localhost user=postgres dbname=postgres sslmode=disable password=root")
|
||||
var err error
|
||||
|
||||
// //PostgreSQL
|
||||
db, err = gorm.Open("postgres", dbString)
|
||||
|
||||
|
||||
db.LogMode(true)
|
||||
|
||||
if err != nil {
|
||||
log.Println("Error initializing the database: ", err)
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user