init
This commit is contained in:
commit
d69342b2e9
160 changed files with 28681 additions and 0 deletions
20
studio/embed.go
Normal file
20
studio/embed.go
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
package studio
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
"path"
|
||||
)
|
||||
|
||||
//go:embed dist/*
|
||||
var distFS embed.FS
|
||||
|
||||
func Handler() http.Handler {
|
||||
sub, _ := fs.Sub(distFS, "dist")
|
||||
return http.FileServer(http.FS(sub))
|
||||
}
|
||||
|
||||
func Read(name string) ([]byte, error) {
|
||||
return distFS.ReadFile(path.Join("dist", name))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue