diff options
Diffstat (limited to 'handlers.go')
| -rw-r--r-- | handlers.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/handlers.go b/handlers.go new file mode 100644 index 0000000..0f6593f --- /dev/null +++ b/handlers.go @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "net/http" +) + +func init() { + router.HandleFunc("/", hello) + router.HandleFunc("/version", version) +} + +func hello(w http.ResponseWriter, r *http.Request) { + fmt.Fprintln(w, "Hello world!") +} + +func version(w http.ResponseWriter, r *http.Request) { + fmt.Fprint(w, versionTxt) +} |
