Implémenter page web de scan de présence
Voir diff pour détails
This commit is contained in:
parent
c6f3a52f91
commit
c218860e33
10 changed files with 139 additions and 10 deletions
12
cmd/web.go
12
cmd/web.go
|
@ -6,7 +6,9 @@ package cmd
|
|||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"git.agecem.com/agecem/bottin-ag/apiclient"
|
||||
"git.agecem.com/agecem/bottin-ag/config"
|
||||
"git.agecem.com/agecem/bottin-ag/webcontent"
|
||||
"git.agecem.com/agecem/bottin-ag/webhandler"
|
||||
|
@ -31,10 +33,18 @@ var webCmd = &cobra.Command{
|
|||
|
||||
e.Pre(middleware.AddTrailingSlash())
|
||||
|
||||
handler := webhandler.New()
|
||||
apiClient := apiclient.New(cfg.Web.API.Key, cfg.Web.API.Host, cfg.Web.API.Protocol, cfg.Web.API.Port)
|
||||
|
||||
handler := webhandler.New(apiClient)
|
||||
|
||||
webhandler.DeclareRoutes(e, &handler)
|
||||
|
||||
publicGroup := e.Group("/public/*")
|
||||
publicGroup.Use(middleware.StaticWithConfig(middleware.StaticConfig{
|
||||
Root: "/",
|
||||
Filesystem: http.FS(webcontent.PublicFS()),
|
||||
}))
|
||||
|
||||
e.Start(fmt.Sprintf(":%d", cfg.Web.Port))
|
||||
},
|
||||
}
|
||||
|
|
Reference in a new issue