Make DEVEL const a flag instead
This commit is contained in:
parent
8eadd7b71e
commit
51aeeb833d
5
main.go
5
main.go
|
@ -25,13 +25,12 @@ var sidewalk_data []byte
|
||||||
|
|
||||||
var buildInfoJSON []byte
|
var buildInfoJSON []byte
|
||||||
|
|
||||||
const DEVEL = false // serve files from dev dir, not embedded, so I don't have to rebuild the app every time
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
devel := flag.Bool("devel", false, "Serve from ./static instead of embedded")
|
||||||
port := flag.Int("port", 8000, "Port to listen on")
|
port := flag.Int("port", 8000, "Port to listen on")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
if DEVEL {
|
if *devel {
|
||||||
http.Handle("GET /", http.FileServer(http.Dir("./static")))
|
http.Handle("GET /", http.FileServer(http.Dir("./static")))
|
||||||
} else {
|
} else {
|
||||||
frontend, err := fs.Sub(embeddedFiles, "static")
|
frontend, err := fs.Sub(embeddedFiles, "static")
|
||||||
|
|
Loading…
Reference in a new issue