546341dec2751495d28f2f1b26c4c954c73a75a5
[goDBhammer.git] / src / webconnector.go
1 // im a web connector
2
3 package main
4
5
6 import (
7         "http";
8         "io";
9         "./dbibridge";
10 )
11
12 // hello world, the web server
13 func HelloServer(c *http.Conn, req *http.Request) {
14         io.WriteString(c, "<html><form method=post><input type=\"input\"><input type=\"submit\" name=\"go\" value=\"go\"></html>\n");
15 }
16
17 func main() {
18         dbibridge.dbiconnect();
19         http.Handle("/hello", http.HandlerFunc(HelloServer));
20         err := http.ListenAndServe(":12345", nil);
21         if err != nil {
22                 panic("ListenAndServe: ", err.String())
23         }
24
25 }