Skip to content

yuin/cidre-bottle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

cidre-bottle: building a packaged cidre webapp binary


cidre-bottle provides an easy way to build a fat binary for web applications using the cidre webframework.

Installation

go get github.com/jteeuwen/go-bindata/...
go get github.com/elazarl/go-bindata-assetfs/...
go get github.com/yuin/cidre-bottle

Usage

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)

License

MIT

Author

Yusuke Inuzuka

About

cidre-bottle: building a packaged cidre webapp binary

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages