Just like asar ๐
go get -u github.com/gizmo-ds/go-asset-bundle
Or install the CLI tools
go install github.com/gizmo-ds/go-asset-bundle/cmd/goab-cli@latest
ab, _ := bundle.NewAssetBundle("./public.ab")
defer ab.Close()
var version uint16 = 1000
ab.Bundle("./public", version)
Or use the CLI tool
goab-cli pack -o="./public.ab" -v=1000 ./public
ab, _ := bundle.OpenAssetBundle("./public.ab")
defer ab.Close()
fmt.Println("Version", ab.Version)
http.Handle("/", http.StripPrefix("/", http.FileServer(ab)))
addr := fmt.Sprintf("127.0.0.1:%d", 3000)
fmt.Println("http server started on", addr)
http.ListenAndServe(addr, nil)
Thanks to JetBrains for the open source license(s).
Code is distributed under MIT license, feel free to use it in your proprietary projects as well.