Skip to content

Commit

Permalink
Deploy attempt #2: db established
Browse files Browse the repository at this point in the history
  • Loading branch information
ksgl committed Oct 21, 2018
1 parent d792e8d commit f162159
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion resources/configs/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@
"structTmpl": "./resources/templates/struct.tmpl",
"routerTmpl": "./resources/templates/router.tmpl"
},
"database": {}
"database": {
"user": "",
"password": "",
"name": ""
}
}
4 changes: 3 additions & 1 deletion server/database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ func New(dbconf_ utiles.DatabaseConfig) *DB {
}

var err error
//postgr.db, err = sql.Open("postgres", fmt.Sprintf("user=%s password=%s dbname=%s sslmode=disable",
//postgr.dbconf.User, postgr.dbconf.Password, postgr.dbconf.Name))
postgr.db, err = sql.Open("postgres", fmt.Sprintf("user=%s password=%s dbname=%s sslmode=disable",
postgr.dbconf.User, postgr.dbconf.Password, postgr.dbconf.Name))
"waveapp", "surf", "wave"))
checkErr(err)
log.Println("postgres connection established")

Expand Down

0 comments on commit f162159

Please sign in to comment.