6
1
mirror of https://git.mills.io/saltyim/saltyim.git synced 2024-06-30 18:51:03 +00:00
prologic-saltyim/internal/embed_resources.go
James Mills be4b4a5e9d Add a basic structure for a go-app PWA + integrated Broker (#36)
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Co-authored-by: Jon Lundy <jon@xuu.cc>
Reviewed-on: https://git.mills.io/prologic/saltyim/pulls/36
2022-03-21 22:27:35 +00:00

30 lines
528 B
Go

//go:build !wasm && !js && embed
// +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" }