init
This commit is contained in:
23
internal/app/assets.go
Normal file
23
internal/app/assets.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
//go:embed web/templates/*.html
|
||||
var templatesFS embed.FS
|
||||
|
||||
//go:embed web/static/*
|
||||
var staticFS embed.FS
|
||||
|
||||
func tfs() fs.FS {
|
||||
sub, _ := fs.Sub(templatesFS, "web/templates")
|
||||
return sub
|
||||
}
|
||||
|
||||
func rfs() http.FileSystem {
|
||||
sub, _ := fs.Sub(staticFS, "web/static")
|
||||
return http.FS(sub)
|
||||
}
|
||||
Reference in New Issue
Block a user