mirror of
https://github.com/MengMengCode/CLICD.git
synced 2026-08-04 21:31:23 +08:00
20 lines
308 B
Go
20 lines
308 B
Go
package server
|
|
|
|
import (
|
|
"embed"
|
|
"io/fs"
|
|
"net/http"
|
|
)
|
|
|
|
//go:embed web/**
|
|
var embeddedWeb embed.FS
|
|
|
|
// GetEmbeddedFS returns the embedded frontend file system
|
|
func GetEmbeddedFS() http.FileSystem {
|
|
sub, err := fs.Sub(embeddedWeb, "web")
|
|
if err != nil {
|
|
return http.Dir("web")
|
|
}
|
|
return http.FS(sub)
|
|
}
|