aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorAdam Mathes <adam@adammathes.com>2026-02-13 20:39:19 -0800
committerAdam Mathes <adam@adammathes.com>2026-02-13 20:39:19 -0800
commit408f88e4d26048396a01bf82e36eb133db3feb24 (patch)
treedd4f06756c775a2955025baf7b370784e34a0af4 /web
parent60cc6f00f681f09c2dbf8aa61b20570370e67efb (diff)
downloadneko-408f88e4d26048396a01bf82e36eb133db3feb24.tar.gz
neko-408f88e4d26048396a01bf82e36eb133db3feb24.tar.bz2
neko-408f88e4d26048396a01bf82e36eb133db3feb24.zip
feat: add vanilla JS frontend prototype (NK-2xsgef)
Diffstat (limited to 'web')
-rw-r--r--web/web.go11
1 files changed, 11 insertions, 0 deletions
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))