mirror of
https://git.mills.io/saltyim/saltyim.git
synced 2024-06-30 18:51:03 +00:00
![James Mills](/assets/img/avatar_default.png)
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
30 lines
528 B
Go
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" }
|