From 5ce35e576b3eebf0153efb84630ff9e94f589eab Mon Sep 17 00:00:00 2001 From: Dan Sosedoff Date: Thu, 9 Oct 2014 19:11:03 -0500 Subject: [PATCH] Add -s option to specify static content location --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 5706a01..f7bc9d3 100644 --- a/main.go +++ b/main.go @@ -40,6 +40,7 @@ var options struct { Port int `short:"p" long:"port" description:"Server port" default:"5432"` User string `short:"u" long:"user" description:"Database user" default:"postgres"` DbName string `short:"d" long:"db" description:"Database name" default:"postgres"` + Static string `short:"s" description:"Path to static assets" default:"./static"` } func getConnectionString() string { @@ -186,7 +187,7 @@ func main() { router.GET("/select", API_RunQuery) router.POST("/select", API_RunQuery) - router.Static("/app", "./static") + router.Static("/app", options.Static) fmt.Println("Starting server at 0.0.0.0:8080") router.Run(":8080")