From 51aeeb833d72c07ff18a8b72c286a0d7a3cfe35e Mon Sep 17 00:00:00 2001 From: Chandler Swift Date: Wed, 12 Feb 2025 23:06:43 -0600 Subject: [PATCH] Make DEVEL const a flag instead --- main.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 758680d..3bd84a1 100644 --- a/main.go +++ b/main.go @@ -25,13 +25,12 @@ var sidewalk_data []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() { + devel := flag.Bool("devel", false, "Serve from ./static instead of embedded") port := flag.Int("port", 8000, "Port to listen on") flag.Parse() - if DEVEL { + if *devel { http.Handle("GET /", http.FileServer(http.Dir("./static"))) } else { frontend, err := fs.Sub(embeddedFiles, "static")