open-vault/http/assets.go
Hamid Ghaf 27bb03bbc0
adding copyright header (#19555)
* adding copyright header

* fix fmt and a test
2023-03-15 09:00:52 -07:00

29 lines
512 B
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
//go:build ui
package http
import (
"embed"
"io/fs"
"net/http"
)
// content is our static web server content.
//
//go:embed web_ui/*
var content embed.FS
// assetFS is a http Filesystem that serves the generated web UI from the
// "ember-dist" make step
func assetFS() http.FileSystem {
// sub out to web_ui, where the generated content lives
f, err := fs.Sub(content, "web_ui")
if err != nil {
panic(err)
}
return http.FS(f)
}