Move to tailwind-build instead of CDNs

This commit is contained in:
Mukhtar Akere
2025-07-10 02:17:35 +01:00
parent c72867ff57
commit cf61546bec
32 changed files with 4149 additions and 20 deletions

View File

@@ -9,12 +9,18 @@ import (
func (wb *Web) Routes() http.Handler {
r := chi.NewRouter()
staticFS, err := fs.Sub(content, "assets")
// Load static files from embedded filesystem
staticFS, err := fs.Sub(assetsEmbed, "assets/build")
if err != nil {
panic(err)
}
imagesFS, err := fs.Sub(imagesEmbed, "assets/images")
if err != nil {
panic(err)
}
r.Handle("/assets/*", http.StripPrefix("/assets/", http.FileServer(http.FS(staticFS))))
r.Handle("/images/*", http.StripPrefix("/images/", http.FileServer(http.FS(imagesFS))))
r.Get("/login", wb.LoginHandler)
r.Post("/login", wb.LoginHandler)