diff --git a/cmd/smweb/main.go b/cmd/smweb/main.go index bec22ae..694ff9c 100644 --- a/cmd/smweb/main.go +++ b/cmd/smweb/main.go @@ -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)