db, err := gorm.Open("mysql", "root:parsh888@/generais?charset=utf8&parseTime=True&loc=Local")
if err != nil {
log.Fatal(err)
}
db.DB()
db.DB().Ping()
db.DB().SetMaxIdleConns(10)
db.DB().SetMaxOpenConns(100)
db.SingularTable(true)
var db gorm.DB
func main() {
router := httprouter.New()
dbConnect, err := gorm.Open("mysql", "root:parsh888@/generais?charset=utf8&parseTime=True&loc=Local")
dbConnect.DB()
dbConnect.DB().Ping()
dbConnect.DB().SetMaxIdleConns(10)
dbConnect.DB().SetMaxOpenConns(100)
dbConnect.SingularTable(true)
if err != nil {
log.Fatal(err)
}
db = dbConnect
router.GET("/auth", kontroller.Auth)
log.Fatal(http.ListenAndServe(":8080", router))
}