Skip to content

Commit

Permalink
refactor(frontend): 使用 go build tag 的方式处理前端模式
Browse files Browse the repository at this point in the history
  • Loading branch information
sunist-c committed Sep 12, 2024
1 parent 3e4c192 commit 905410d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
9 changes: 9 additions & 0 deletions app/router/frontend.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//go:build frontend

package router

import "github.com/alioth-center/akasha-whisper/frontend"

func init() {
_ = frontend.ManagementModule
}
5 changes: 0 additions & 5 deletions app/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ func serveBackend() {
engine.ServeAsync(global.Config.HttpEngine.ServeAddr, make(chan struct{}, 1))
}

func serveFrontend() {
// todo: serve frontend
}

func init() {
go serveBackend()
go serveFrontend()
}
6 changes: 2 additions & 4 deletions frontend/embeddings.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
//go:build frontend

package frontend

import "embed"

// ManagementModule is the embedded frontend module for management.
//
// nolint
//
//go:embed management/dist/*
var ManagementModule embed.FS

0 comments on commit 905410d

Please sign in to comment.