feat: embed dist

This commit is contained in:
naiba
2024-11-29 21:31:39 +08:00
parent fb99e88487
commit 970c0d0430
7 changed files with 83 additions and 50 deletions

View File

@@ -2,6 +2,8 @@ package main
import (
"context"
"embed"
_ "embed"
"flag"
"fmt"
"log"
@@ -32,6 +34,10 @@ type DashboardCliParam struct {
var (
dashboardCliParam DashboardCliParam
//go:embed admin-dist
adminFrontend embed.FS
//go:embed user-dist
userFrontend embed.FS
)
func initSystem() {
@@ -119,7 +125,7 @@ func main() {
singleton.NewServiceSentinel(serviceSentinelDispatchBus)
grpcHandler := rpc.ServeRPC()
httpHandler := controller.ServeWeb()
httpHandler := controller.ServeWeb(adminFrontend, userFrontend)
controller.InitUpgrader()
muxHandler := newHTTPandGRPCMux(httpHandler, grpcHandler)