diff options
| author | Rose Hogenson <rosehogenson@posteo.net> | 2024-10-17 17:10:52 -0700 |
|---|---|---|
| committer | Rose Hogenson <rosehogenson@posteo.net> | 2024-10-17 17:10:52 -0700 |
| commit | dd07600f8844e90d3076b73f731565a9a8455db0 (patch) | |
| tree | 8a97382e49293bb8e0d2aa6246b309325985c2cb /roseh.moe.go | |
| parent | Add a 404 page. (diff) | |
| download | roseh.moe-dd07600f8844e90d3076b73f731565a9a8455db0.tar.zst | |
Simplify routing.
Diffstat (limited to 'roseh.moe.go')
| -rw-r--r-- | roseh.moe.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/roseh.moe.go b/roseh.moe.go index ea7f4a3..d69ec06 100644 --- a/roseh.moe.go +++ b/roseh.moe.go @@ -52,15 +52,12 @@ var static embed.FS func main() { flag.Parse() + mux := http.NewServeMux() jellyfinURL, err := url.Parse("http://localhost:8096") if err != nil { log.Fatalf("Jellyfin URL: %s", err) } - - mux := http.NewServeMux() - jellyfinProxy := httputil.NewSingleHostReverseProxy(jellyfinURL) - mux.Handle("/cinema", jellyfinProxy) - mux.Handle("/cinema/", jellyfinProxy) + mux.Handle("/cinema/", httputil.NewSingleHostReverseProxy(jellyfinURL)) mux.Handle("/static/", http.FileServerFS(static)) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { if r.URL.Path == "/" { |
