summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2024-10-17 17:10:52 -0700
committerRose Hogenson <rosehogenson@posteo.net>2024-10-17 17:10:52 -0700
commitdd07600f8844e90d3076b73f731565a9a8455db0 (patch)
tree8a97382e49293bb8e0d2aa6246b309325985c2cb
parent5a5ad101047b30958ecc8ffe1921f90bd4591c94 (diff)
downloadroseh.moe-dd07600f8844e90d3076b73f731565a9a8455db0.tar.zst
Simplify routing.
-rw-r--r--roseh.moe.go7
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 == "/" {