cidre-bottle provides an easy way to build a fat binary for web applications using the cidre webframework.
go get github.com/jteeuwen/go-bindata/...
go get github.com/elazarl/go-bindata-assetfs/...
go get github.com/yuin/cidre-bottle
directory structure:
+- assets
+- templates
+- page.tpl
+- layout.tpl
+- statics
+- css
+- app.css
+- js
+- app.js
+- img
+- logo.png
Runs a go-bindata command.
go-bindata assets/...
Modify cidre app codes.
app := cidre.NewApp(appConfig)
// Set a renderer with a go-bindata support
app.Hooks.Add("setup", func(w http.ResponseWriter, r *http.Request, data interface{}) {
app.Renderer := bottle.NewHtmlTemplateRenderer(app.Renderer, Asset, AssetDir)
})
root := app.MountPoint("/")
// Serve static files
bottle.Static(root, "statics", "statics", "assets/statics", Asset, AssetDir)
MIT
Yusuke Inuzuka