From: Paul J R Date: Mon, 16 Nov 2009 02:30:44 +0000 (+1100) Subject: changed web interface to static files + json interface X-Git-Url: http://git.pjr.cc/?a=commitdiff_plain;h=c9ff4815a53c91a582619a41e7952571c02f6075;p=goDBhammer.git changed web interface to static files + json interface --- diff --git a/src/dbconnector.go b/src/dbconnector.go index 637aa84..0123d4d 100644 --- a/src/dbconnector.go +++ b/src/dbconnector.go @@ -3,6 +3,7 @@ package dbconnector import ( "./dbibridge"; + //"strings"; "time"; "rand"; "fmt"; @@ -15,22 +16,22 @@ type DBConnector struct { func CreateRandomText(len int) (str string) { - buf := make([]byte, len+2); + buf := make([]byte, len); rand.Seed(time.Nanoseconds()); for i:=0; i + + + +Insert title here + + + + + \ No newline at end of file diff --git a/src/webconnector.go b/src/webconnector.go index e7436d3..fa814f3 100644 --- a/src/webconnector.go +++ b/src/webconnector.go @@ -135,7 +135,8 @@ func main() 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())