Refactor admin frontend build
Some checks failed
Docker Image / docker (push) Has been cancelled

This commit is contained in:
2026-06-25 21:16:11 +08:00
parent bf6db8c455
commit ecb682bb41
34 changed files with 1474 additions and 692 deletions

View File

@@ -1,20 +1,15 @@
package main
import (
"embed"
"net/http"
"github.com/tursom/mc-gateway/internal/adminhttp"
)
//go:embed admin_static/index.html admin_static/app.css admin_static/app.js
var adminStaticFS embed.FS
func newGatewayHTTPHandler() http.Handler {
return adminhttp.NewGatewayHandler(adminhttp.GatewayHandlerOptions{
AdminPath: adminStartup.AdminPath,
AdminAPIPrefix: adminStartup.AdminAPIPrefix,
Assets: adminStaticFS,
APIHandler: newAdminAPIHandler(),
WebSocketEnabled: config.WebSocket.Enable,
WebSocketPath: normalizedWebSocketPath(),