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 361315418f Revert "Fix build tag for pwa app.wasm"
This reverts commit 0ecaec69f892418d6d4706c8f2ecf307c0b50248.
2022-03-22 11:06:37 +10: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" }