Add frontend pages, move static to www/, add resolution to tester
Frontend: - index.html: probe device, navigate to standard/homekit by type - standard.html: camera config, model search with multi-select - create.html: stream URL list, custom URL input, create test session - homekit.html: HomeKit device info, contact links, fallback to standard Backend: - Move static files to www/ package with embed (go2rtc pattern) - Add initStatic() in api with FileServer - Add width/height to test results from H264 SPS parsing - Contribute links to gostrix.github.io with auto-filled params
This commit is contained in:
+1
-9
@@ -1,9 +1,7 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"encoding/json"
|
||||
"io/fs"
|
||||
"net"
|
||||
"net/http"
|
||||
"time"
|
||||
@@ -25,10 +23,7 @@ func Init() {
|
||||
HandleFunc("api/health", apiHealth)
|
||||
HandleFunc("api/log", apiLog)
|
||||
|
||||
// serve frontend from embedded web/ directory
|
||||
if sub, err := fs.Sub(webFS, "web"); err == nil {
|
||||
http.Handle("/", http.FileServer(http.FS(sub)))
|
||||
}
|
||||
initStatic()
|
||||
|
||||
Handler = middlewareCORS(http.DefaultServeMux)
|
||||
|
||||
@@ -39,9 +34,6 @@ func Init() {
|
||||
go listen_serve("tcp", listen)
|
||||
}
|
||||
|
||||
//go:embed web
|
||||
var webFS embed.FS
|
||||
|
||||
func listen_serve(network, address string) {
|
||||
ln, err := net.Listen(network, address)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user