From f9975a634cfab80f9e0c51be465248a5f8f82f49 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Tue, 3 Apr 2012 10:05:21 -0400 Subject: [PATCH] Remove server.SetConfig and just pass it to RunBackEnd --- main.go | 3 +-- server/server.go | 8 +++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/main.go b/main.go index c957177..07d97b2 100644 --- a/main.go +++ b/main.go @@ -53,6 +53,5 @@ func main() { // Run the server. fmt.Printf("Starting Armadillo on port %d with root:\n %v\n", configuration.Port, configuration.JailRoot) - server.SetConfig(configuration) - server.RunBackEnd() + server.RunBackEnd(configuration) } diff --git a/server/server.go b/server/server.go index 656a184..d5941a8 100644 --- a/server/server.go +++ b/server/server.go @@ -27,10 +27,6 @@ var dir, file = path.Split(path.Clean(os.Getenv("_"))) var kFrontEndFiles string = path.Join(dir, "frontend") var gConfig *config.Configuration -func SetConfig(aConfig *config.Configuration) { - gConfig = aConfig -} - func indexHandler(response http.ResponseWriter, request *http.Request) { fd, err := os.Open(path.Join(kFrontEndFiles, "index.html")) if err != nil { @@ -201,7 +197,9 @@ func okResponse(response http.ResponseWriter, data interface{}) { } } -func RunBackEnd() { +func RunBackEnd(c *config.Configuration) { + gConfig = c + mux := http.NewServeMux() mux.HandleFunc("/", indexHandler) mux.Handle("/fe/", http.StripPrefix("/fe/", http.FileServer(http.Dir(kFrontEndFiles)))) -- 2.43.5