diff options
| author | Adam Mathes <adam@adammathes.com> | 2026-02-13 20:39:19 -0800 |
|---|---|---|
| committer | Adam Mathes <adam@adammathes.com> | 2026-02-13 20:39:19 -0800 |
| commit | 408f88e4d26048396a01bf82e36eb133db3feb24 (patch) | |
| tree | dd4f06756c775a2955025baf7b370784e34a0af4 /web/web.go | |
| parent | 60cc6f00f681f09c2dbf8aa61b20570370e67efb (diff) | |
| download | neko-408f88e4d26048396a01bf82e36eb133db3feb24.tar.gz neko-408f88e4d26048396a01bf82e36eb133db3feb24.tar.bz2 neko-408f88e4d26048396a01bf82e36eb133db3feb24.zip | |
feat: add vanilla JS frontend prototype (NK-2xsgef)
Diffstat (limited to 'web/web.go')
| -rw-r--r-- | web/web.go | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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)) |
