feat: Bundle assets in binary using go:embed (#340)

Fixes #47
This commit is contained in:
TwiN
2022-10-09 21:33:31 -04:00
committed by GitHub
parent 47dd18a0b5
commit 00b56ecefd
16 changed files with 135 additions and 83 deletions

View File

@ -9,7 +9,6 @@ import (
"time"
"github.com/TwiN/gatus/v4/config"
"github.com/TwiN/gatus/v4/config/ui"
"github.com/TwiN/gatus/v4/controller/handler"
)
@ -21,7 +20,7 @@ var (
// Handle creates the router and starts the server
func Handle(cfg *config.Config) {
var router http.Handler = handler.CreateRouter(ui.StaticFolder, cfg)
var router http.Handler = handler.CreateRouter(cfg)
if os.Getenv("ENVIRONMENT") == "dev" {
router = handler.DevelopmentCORS(router)
}