Flow optimization

This commit is contained in:
2025-12-02 20:27:05 +08:00
parent 0c097d63a6
commit d9abb0b18b
4 changed files with 28 additions and 57 deletions

View File

@@ -11,7 +11,7 @@ func indexHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Server", "MeowMusicEmbeddedServer")
w.Header().Set("Content-Type", "text/html; charset=utf-8")
fmt.Printf("[Web Access] Handling request for %s\n", r.URL.Path)
// Serve full music app for both / and /app
if r.URL.Path == "/" || r.URL.Path == "/app" {
appPath := filepath.Join("theme", "full-app.html")
@@ -21,7 +21,7 @@ func indexHandler(w http.ResponseWriter, r *http.Request) {
return
}
}
// Test version available at /test
if r.URL.Path == "/test" {
testPath := filepath.Join("theme", "test-app.html")
@@ -31,7 +31,7 @@ func indexHandler(w http.ResponseWriter, r *http.Request) {
return
}
}
// Access classic interface via /classic
if r.URL.Path == "/classic" {
indexPath := filepath.Join("theme", "index.html")
@@ -43,7 +43,7 @@ func indexHandler(w http.ResponseWriter, r *http.Request) {
defaultIndexPage(w)
return
}
if r.URL.Path != "/" {
fileHandler(w, r)
return