package main import ( "embed" "net/http" "html/template" "github.com/senpro-it/test-daisyui/components" "github.com/a-h/templ" ) //go:embed public/output.css var cssContent embed.FS //go:embed shell.html var htmlContent embed.FS func main() { http.HandleFunc("/style.css", func(w http.ResponseWriter, r *http.Request) { data, err := cssContent.ReadFile("public/output.css") if err != nil { http.Error(w, "Could not read CSS file", http.StatusInternalServerError) return } w.Header().Set("Content-Type", "text/css") w.Write(data) }) http.Handle("/", templ.Handler(components.Main())) /* http.Handle("/a", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { shellContent, _ := htmlContent.ReadFile("shell.html") shell := template.New(string(shellContent)) base := templ.FromGoHTML(shell, map[string]templ.Component{ "head": nil, "body": }) })) */ http.ListenAndServe(":9898", nil) }