oops debug logs
parent
9a38033b65
commit
41a39c40d0
|
|
@ -104,19 +104,15 @@ func (ws WS) serveProxy(w http.ResponseWriter, r *http.Request) error {
|
||||||
var staticFiles embed.FS
|
var staticFiles embed.FS
|
||||||
|
|
||||||
func (ws WS) serveStaticFile(w http.ResponseWriter, r *http.Request) error {
|
func (ws WS) serveStaticFile(w http.ResponseWriter, r *http.Request) error {
|
||||||
log.Println("serveStaticFile", 0, r.URL.Path)
|
|
||||||
if FlagWSDebug {
|
if FlagWSDebug {
|
||||||
b, _ := os.ReadFile("src/device/input/raw/public/root.html")
|
b, _ := os.ReadFile("src/device/input/raw/public/root.html")
|
||||||
w.Write(b)
|
w.Write(b)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
log.Println("serveStaticFile", 1, r.URL.Path)
|
|
||||||
if r.URL.Path == "/" {
|
if r.URL.Path == "/" {
|
||||||
r.URL.Path = "root.html"
|
r.URL.Path = "root.html"
|
||||||
}
|
}
|
||||||
log.Println("serveStaticFile", 2, r.URL.Path)
|
|
||||||
r.URL.Path = path.Join("public", r.URL.Path)
|
r.URL.Path = path.Join("public", r.URL.Path)
|
||||||
log.Println("serveStaticFile", 3, r.URL.Path)
|
|
||||||
http.FileServer(http.FS(staticFiles)).ServeHTTP(w, r)
|
http.FileServer(http.FS(staticFiles)).ServeHTTP(w, r)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue