MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / initStatic

Function initStatic

server/static/static.go:37–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35var static fs.FS
36
37func initStatic() {
38 utils.Log.Debug("Initializing static file system...")
39 if conf.Conf.DistDir == "" {
40 dist, err := fs.Sub(public.Public, "dist")
41 if err != nil {
42 utils.Log.Fatalf("failed to read dist dir: %v", err)
43 }
44 static = dist
45 utils.Log.Debug("Using embedded dist directory")
46 return
47 }
48 static = os.DirFS(conf.Conf.DistDir)
49 utils.Log.Infof("Using custom dist directory: %s", conf.Conf.DistDir)
50}
51
52func replaceStrings(content string, replacements map[string]string) string {
53 for old, new := range replacements {

Callers 1

StaticFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected