From c9ff4815a53c91a582619a41e7952571c02f6075 Mon Sep 17 00:00:00 2001 From: Paul J R Date: Mon, 16 Nov 2009 13:30:44 +1100 Subject: [PATCH] changed web interface to static files + json interface --- src/dbconnector.go | 29 +++++++++++++++-------------- src/dbibridge.go | 8 +++++--- src/web/index.html | 10 ++++++++++ src/webconnector.go | 3 ++- 4 files changed, 32 insertions(+), 18 deletions(-) create mode 100644 src/web/index.html 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()) -- 1.7.0.4