Null-DRM-Official/apps/streamd/internal/ui/ui.go
404errordeveloper 2fa8f2435f Initial commit: Null DRM Official
Capture, decrypt, and restream toolkit with compiled-in app modules
(RTE, TG4, BBC), on-device MITM proxy, streamd control plane, and www.
BBC module.yaml is published (clear streams); other module values stay local.
2026-10-06 00:25:35 +02:00

34 lines
636 B
Go

package ui
import (
"embed"
"io/fs"
"net/http"
)
//go:embed index.html app.css app.js
var files embed.FS
func Handler() http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path != "/" && r.URL.Path != "/index.html" {
http.NotFound(w, r)
return
}
b, err := files.ReadFile("index.html")
if err != nil {
http.Error(w, err.Error(), 500)
return
}
w.Header().Set("Content-Type", "text/html; charset=utf-8")
_, _ = w.Write(b)
})
}
func Static() http.Handler {
sub, err := fs.Sub(files, ".")
if err != nil {
panic(err)
}
return http.FileServer(http.FS(sub))
}