goassest

command module
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2016 License: MIT Imports: 15 Imported by: 0

README

goassest

go assets tool

install

go get -u github.com/hidu/goassest

useage

 goassest  [-src=res] [-dest=demo] [-package=res] [assest.json]

output file is assest.go in assest dir

assest conf is: assest.json:

{
  "src":"res",
  "dest":"serve/assest.go",
  "package":"serve"
}
    http.HandleFunc("/index.html", res.Assest.FileHandlerFunc("res/index.html"))
    http.Handle("/res/", res.Assest.HttpHandler("/"))
    
    http.Handle("/js/",res.Assest.HTTPHandler("/res/"))
    
    http.Handle("/static/",http.StripPrefix("/static/",res.Assest.HTTPHandler("/res/")))
    
    content:=res.Assest.GetContent("res/b.css")
    fmt.Println("b.css content:",content)
    
    names := res.Assest.GetFileNames("/")

the demo main.go

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
res

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL