21 lines
634 B
Go
21 lines
634 B
Go
// 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)
|
|
}
|