24 lines
336 B
Go
24 lines
336 B
Go
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)
|
|
}
|