add frontend requirement

This commit is contained in:
Aynakeya
2022-07-12 21:48:06 -07:00
parent 94615265bf
commit d90311acfe
2 changed files with 208 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
package webinfo
import (
"AynaLivePlayer/config"
"context"
"encoding/json"
"fmt"
@@ -35,7 +36,7 @@ func NewWebInfoServer(port int) *WebInfoServer {
Clients: map[*Client]int{},
}
mux := http.NewServeMux()
mux.Handle("/", http.FileServer(http.Dir("./assets/webinfo")))
mux.Handle("/", http.FileServer(http.Dir(config.GetAssetPath("webinfo"))))
mux.HandleFunc("/ws/info", server.handleInfo)
mux.HandleFunc("/api/info", server.getInfo)
server.Server = &http.Server{