feat add main with user route
parent
f6c66e44aa
commit
66ed6dd35d
|
@ -0,0 +1,38 @@
|
|||
/**
|
||||
* Created by fbonhomm
|
||||
* Email: flo-github@outlook.fr
|
||||
* Licence: MIT
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/fbonhomm/api-go/source/config"
|
||||
"github.com/fbonhomm/api-go/source/routers"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/joho/godotenv"
|
||||
"log"
|
||||
)
|
||||
|
||||
// init
|
||||
func init() {
|
||||
if err := godotenv.Load(); err != nil {
|
||||
log.Fatal("No .env file found")
|
||||
}
|
||||
}
|
||||
|
||||
// main
|
||||
func main() {
|
||||
// Initialize Database
|
||||
db := config.Database()
|
||||
|
||||
routerEngine := gin.Default()
|
||||
|
||||
routers.User(routerEngine)
|
||||
// for route := range routers {
|
||||
// route(routerEngine)
|
||||
// }
|
||||
|
||||
routerEngine.Run()
|
||||
db.Close()
|
||||
}
|
Loading…
Reference in New Issue