feat: монолит iot-service (Фаза 1) — config/store/api/bridge/consumer без k8s, устройства в PG, новые Dockerfile/Makefile
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
// console_embed.go — встраивает HTML IoT консоли в бинарник.
|
||||
package api
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// iotConsoleHTML — консоль /console, встроена при сборке.
|
||||
//
|
||||
//go:embed ui/iot-console.html
|
||||
var iotConsoleHTML []byte
|
||||
|
||||
// ServeIoTConsole отдаёт HTML консоли.
|
||||
func ServeIoTConsole(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||
w.Header().Set("Cache-Control", "no-cache, must-revalidate")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
_, _ = w.Write(iotConsoleHTML)
|
||||
}
|
||||
Reference in New Issue
Block a user