2 Commits
Author SHA1 Message Date
sm 8096c76b1e added development fileserving 2015-02-09 23:11:06 -08:00
sm d98ef7a4a9 added generated static file 2015-02-09 23:10:53 -08:00
2 changed files with 304 additions and 7 deletions
+12 -7
View File
@@ -2,21 +2,26 @@ package main
import (
"net/http"
"os"
"github.com/elazarl/go-bindata-assetfs"
"mcquay.me/web"
)
func main() {
var fs http.FileSystem
if os.Getenv("SM_DEV") == "" {
fs = &assetfs.AssetFS{
Asset: web.Asset,
AssetDir: web.AssetDir,
Prefix: "static",
}
} else {
fs = http.Dir(os.Getenv("SM_STATIC"))
}
http.Handle(
"/",
http.FileServer(
&assetfs.AssetFS{
Asset: web.Asset,
AssetDir: web.AssetDir,
Prefix: "static",
},
),
http.FileServer(fs),
)
if err := http.ListenAndServe(":8000", nil); err != nil {
panic(err)
+292
View File
File diff suppressed because one or more lines are too long