changed web interface to static files + json interface
[goDBhammer.git] / src / webconnector.go
index de43ec6..fa814f3 100644 (file)
@@ -8,6 +8,7 @@ import (
        "io";
        //"./dbibridge";
        "./benchcontroller";
+       //"dbconnector";
        "fmt";
 )
 
@@ -50,6 +51,7 @@ func beginPage(c *http.Conn, req *http.Request)
                //dbname := req.FormValue("dbname");
                //nthreads := req.FormValue("nthreads");
                //dbmult := req.FormValue("dbmult");
+               comout <- "begin:setup";
                
                footer(c);
        }
@@ -129,10 +131,12 @@ func main()
        comin = make(chan string);
        comout = make(chan string);
        
+       
        bc := benchcontroller.CreateController();
        go benchcontroller.MainLoop(bc, comout, comin);
        
-       http.Handle("/", http.HandlerFunc(ServerResponder));
+       http.Handle("/", http.FileServer("./web", "/web"));
+       http.Handle("/json", http.HandlerFunc(ServerResponder));
        err := http.ListenAndServe(":22222", nil);
        if err != nil {
                panic("ListenAndServe: ", err.String())