6
1
mirror of https://git.mills.io/saltyim/saltyim.git synced 2024-06-25 16:28:20 +00:00
prologic-saltyim/internal/embed_resources.go
2022-03-22 11:08:04 +10:00

29 lines
502 B
Go

//go:build !wasm && !js && embed
package internal
import (
"embed"
"net/http"
log "github.com/sirupsen/logrus"
)
//go:embed web
var embeddedWeb embed.FS
func init() {
log.Info("loading wasm resources...")
resources = resourcesFS{
Handler: http.FileServer(http.FS(embeddedWeb)),
}
}
type resourcesFS struct {
http.Handler
}
func (resourcesFS) Package() string { return "" }
func (resourcesFS) Static() string { return "" }
func (resourcesFS) AppWASM() string { return "/web/app.wasm" }