From 408f88e4d26048396a01bf82e36eb133db3feb24 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Fri, 13 Feb 2026 20:39:19 -0800 Subject: feat: add vanilla JS frontend prototype (NK-2xsgef) --- web/web.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'web/web.go') diff --git a/web/web.go b/web/web.go index 1a0270e..c9ff5e0 100644 --- a/web/web.go +++ b/web/web.go @@ -30,6 +30,7 @@ var gzPool = sync.Pool{ var ( staticBox *rice.Box frontendBox *rice.Box + vanillaBox *rice.Box ) func init() { @@ -43,6 +44,11 @@ func init() { if err != nil { log.Printf("Warning: Could not find frontendBox at ../frontend/dist: %v", err) } + + vanillaBox, err = rice.FindBox("../vanilla") + if err != nil { + log.Printf("Warning: Could not find vanillaBox at ../vanilla: %v", err) + } } func indexHandler(w http.ResponseWriter, r *http.Request) { @@ -236,6 +242,11 @@ func NewRouter() http.Handler { apiRouter := api.NewRouter() mux.Handle("/api/", GzipMiddleware(http.StripPrefix("/api", AuthWrapHandler(apiRouter)))) + // Vanilla JS Prototype + if vanillaBox != nil { + mux.Handle("/vanilla/", GzipMiddleware(http.StripPrefix("/vanilla/", http.FileServer(vanillaBox.HTTPBox())))) + } + // Legacy routes for backward compatibility mux.HandleFunc("/stream/", AuthWrap(api.HandleStream)) mux.HandleFunc("/item/", AuthWrap(api.HandleItem)) -- cgit v1.2.3