added go-bindata handler and generate commands

This commit is contained in:
Stephen McQuay 2015-02-09 23:01:28 -08:00
parent 31cd542929
commit e5e9e5f494
2 changed files with 14 additions and 2 deletions

View File

@ -2,14 +2,20 @@ package main
import (
"net/http"
"os"
"github.com/elazarl/go-bindata-assetfs"
"mcquay.me/web"
)
func main() {
http.Handle(
"/",
http.FileServer(
http.Dir(os.Getenv("SM_STATIC")),
&assetfs.AssetFS{
Asset: web.Asset,
AssetDir: web.AssetDir,
Prefix: "static",
},
),
)
if err := http.ListenAndServe(":8000", nil); err != nil {

6
web.go Normal file
View File

@ -0,0 +1,6 @@
package web
//go:generate go get github.com/jteeuwen/go-bindata/...
//go:generate go get github.com/elazarl/go-bindata-assetfs/...
//go:generate rm -f static.go
//go:generate go-bindata -o static.go -pkg=web static/...