diff options
| author | Adam Mathes <adam@adammathes.com> | 2026-02-15 21:58:27 -0800 |
|---|---|---|
| committer | Adam Mathes <adam@adammathes.com> | 2026-02-15 21:58:27 -0800 |
| commit | 7196992916b42fe6180c0d05331716c52fac79b0 (patch) | |
| tree | e321df891b7bffe09eba698f1d1c091a2b546c8d /web/web.go | |
| parent | 174987660473d4cdc1ad6857e5513a69f265f614 (diff) | |
| download | neko-7196992916b42fe6180c0d05331716c52fac79b0.tar.gz neko-7196992916b42fe6180c0d05331716c52fac79b0.tar.bz2 neko-7196992916b42fe6180c0d05331716c52fac79b0.zip | |
Web: Make vanilla (v3) frontend the default at root, move react (v2) to /v2/
Diffstat (limited to 'web/web.go')
| -rw-r--r-- | web/web.go | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -223,15 +223,14 @@ func NewRouter(cfg *config.Settings) http.Handler { staticSub, _ := fs.Sub(staticFiles, "static") mux.Handle("/static/", GzipMiddleware(http.StripPrefix("/static/", http.FileServer(http.FS(staticSub))))) - // New Frontend (React/Vite) from web/dist/v2 - // Default route - mux.Handle("/", GzipMiddleware(ServeFrontend("dist/v2"))) - // Also keep /v2/ for explicit access - mux.Handle("/v2/", GzipMiddleware(http.StripPrefix("/v2/", ServeFrontend("dist/v2")))) - - // Vanilla JS (v3) + // Default route: Vanilla JS (v3) + mux.Handle("/", GzipMiddleware(ServeFrontend("dist/v3"))) + // Access v3 explicitly mux.Handle("/v3/", GzipMiddleware(http.StripPrefix("/v3/", ServeFrontend("dist/v3")))) + // React Frontend (v2) at /v2/ + mux.Handle("/v2/", GzipMiddleware(http.StripPrefix("/v2/", ServeFrontend("dist/v2")))) + // Legacy UI at /v1/ mux.Handle("/v1/", GzipMiddleware(http.StripPrefix("/v1/", AuthWrap(http.HandlerFunc(indexHandler))))) |
