1
0
dwelling-files/web/web.go

22 lines
371 B
Go
Raw Normal View History

2022-06-27 04:38:09 +04:00
package web
import (
"embed"
"io/fs"
"net/http"
)
//go:generate $GOPATH/bin/jade -pkg=web -stdlib -stdbuf -writer templates/index.jade
//go:embed assets
var assetsDir embed.FS
func Assets() http.FileSystem {
f, _ := fs.Sub(assetsDir, "assets")
return http.FS(f)
}
func AssetsGetFile(path string) ([]byte, error) {
return assetsDir.ReadFile("assets/" + path)
}