added template files to be included in the binary

This commit is contained in:
Stefan Etringer 2025-06-24 14:43:32 +00:00
parent 92c26172c6
commit 7472e2384e
1 changed files with 3 additions and 1 deletions

View File

@ -40,7 +40,8 @@ var (
//go:embed static/* //go:embed static/*
var staticFiles embed.FS var staticFiles embed.FS
//go:embed templates
var templateFiles embed.FS
type Config struct { type Config struct {
Database struct { Database struct {
@ -404,6 +405,7 @@ func main() {
webMux.HandleFunc("/logs", logsHandler) webMux.HandleFunc("/logs", logsHandler)
webMux.HandleFunc("/logs/{level}", logsHandler) webMux.HandleFunc("/logs/{level}", logsHandler)
webMux.Handle("/static/", http.FileServer(http.FS(staticFiles))) webMux.Handle("/static/", http.FileServer(http.FS(staticFiles)))
webMux.Handle("/templates/", http.FileServer(http.FS(templateFiles)))
webMux.HandleFunc("/proxyAgent", proxyAgentHandler) webMux.HandleFunc("/proxyAgent", proxyAgentHandler)
// db := database.InitDB (cfg.Database.Username, cfg.Database.Password, cfg.Database.Host, cfg.Database.Port, cfg.Database.Name) // db := database.InitDB (cfg.Database.Username, cfg.Database.Password, cfg.Database.Host, cfg.Database.Port, cfg.Database.Name)