feat: монолит iot-service (Фаза 1) — config/store/api/bridge/consumer без k8s, устройства в PG, новые Dockerfile/Makefile
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
// admin_embed.go — встраивает HTML страницы администратора в бинарник.
|
||||
package api
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// iotAdminHTML — страница /iot-admin, встроена при сборке.
|
||||
//
|
||||
//go:embed ui/iot-admin.html
|
||||
var iotAdminHTML []byte
|
||||
|
||||
// ServeIoTAdmin отдаёт HTML страницу администратора.
|
||||
func ServeIoTAdmin(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(iotAdminHTML)
|
||||
}
|
||||
Reference in New Issue
Block a user