2022-06-27 04:38:09 +04:00
|
|
|
package web
|
|
|
|
|
|
|
|
import (
|
|
|
|
"embed"
|
|
|
|
"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 {
|
2022-06-28 00:37:20 +04:00
|
|
|
return http.FS(assetsDir)
|
2022-06-27 04:38:09 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
func AssetsGetFile(path string) ([]byte, error) {
|
|
|
|
return assetsDir.ReadFile("assets/" + path)
|
|
|
|
}
|