22 lines
387 B
Go
22 lines
387 B
Go
package customerui
|
|
|
|
import (
|
|
"embed"
|
|
"io/fs"
|
|
"net/http"
|
|
)
|
|
|
|
//go:embed dist/public/* dist/admin/*
|
|
var dist embed.FS
|
|
|
|
func handler(sub string) http.Handler {
|
|
root, err := fs.Sub(dist, sub)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return http.FileServer(http.FS(root))
|
|
}
|
|
|
|
func Public() http.Handler { return handler("dist/public") }
|
|
func Admin() http.Handler { return handler("dist/admin") }
|