mirror of
https://gitee.com/energye/energy.git
synced 2024-12-05 05:08:17 +08:00
03e3f74c7f
2. 增加内置资源http服务
19 lines
297 B
Go
19 lines
297 B
Go
package assetserve
|
|
|
|
import (
|
|
"embed"
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
//go:embed assets
|
|
var assets embed.FS
|
|
|
|
func TestServer(t *testing.T) {
|
|
server := NewAssetsHttpServer()
|
|
server.AssetsFSName = "assets" //必须设置目录名
|
|
server.Assets = &assets
|
|
err := server.StartHttpServer()
|
|
fmt.Println(err)
|
|
}
|