diff options
| author | Rose Hogenson <rosehogenson@posteo.net> | 2026-07-13 21:29:18 -0700 |
|---|---|---|
| committer | Rose Hogenson <rosehogenson@posteo.net> | 2026-07-13 21:29:18 -0700 |
| commit | e0ca1bde9435ade640a12ca93965e88866c3b856 (patch) | |
| tree | 8b294b808df419ea6514b99a06705e09f708b8ca /roseh.moe.go | |
| parent | 454214e78be73afa8784d283ac0aa01baeacc996 (diff) | |
| download | roseh.moe-e0ca1bde9435ade640a12ca93965e88866c3b856.tar.zst | |
Handle routing errors in a more sensible way
Diffstat (limited to 'roseh.moe.go')
| -rw-r--r-- | roseh.moe.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/roseh.moe.go b/roseh.moe.go index f71761c..20c2101 100644 --- a/roseh.moe.go +++ b/roseh.moe.go @@ -855,8 +855,10 @@ func main() { mux.Handle("GET /code/", http.StripPrefix("/code/", http.FileServer(http.Dir(*codeDir)))) mux.HandleFunc("GET /static/", static) mux.HandleFunc("GET /favicon.ico", favicon) - mux.HandleFunc("PUT /api/wormhole/{name}", wormholeAPIUpload) - mux.HandleFunc("GET /", notFound) + apiMux := http.NewServeMux() + apiMux.HandleFunc("PUT /api/wormhole/{name}", wormholeAPIUpload) + mux.Handle("/api/", apiMux) + mux.HandleFunc("/", notFound) http.Handle("/", http.NewCrossOriginProtection().Handler(mux)) jellyfinURL, err := url.Parse("http://127.0.0.1:8096") if err != nil { |
