Remove server.SetConfig and just pass it to RunBackEnd
authorRobert Sesek <rsesek@bluestatic.org>
Tue, 3 Apr 2012 14:05:21 +0000 (10:05 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Tue, 3 Apr 2012 14:05:21 +0000 (10:05 -0400)
main.go
server/server.go

diff --git a/main.go b/main.go
index c95717796631bf3c046b7d91ae5da2f3114e0568..07d97b22d178ee95f084b0f7796c15f863882d20 100644 (file)
--- 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)
 }
index 656a184f1809d50c06c891786f86cfc05169714c..d5941a826e2b7379da687f8dc8fc5ff7883d7347 100644 (file)
@@ -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))))