mirror of
https://github.com/MengMengCode/CLICD.git
synced 2026-08-07 14:14:44 +08:00
first commit
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user