From 60fc35e6c85edf08cbd2d9523a9bf339c709ee2f Mon Sep 17 00:00:00 2001 From: Stephen McQuay Date: Wed, 8 May 2013 22:57:52 -0700 Subject: [PATCH] stubbed out go handlers --- handlers.go | 13 +++++++++++++ main.go | 2 ++ static/index.html | 8 ++++---- 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 handlers.go diff --git a/handlers.go b/handlers.go new file mode 100644 index 0000000..3652453 --- /dev/null +++ b/handlers.go @@ -0,0 +1,13 @@ +package main + +import ( + "net/http" +) + +func attempt(w http.ResponseWriter, req *http.Request) { + w.Write([]byte("hello")) +} + +func problem(w http.ResponseWriter, req *http.Request) { + w.Write([]byte("hello")) +} diff --git a/main.go b/main.go index 7ffa295..49cdfb5 100644 --- a/main.go +++ b/main.go @@ -16,6 +16,8 @@ func main() { flag.Parse() http.Handle("/", http.FileServer(http.Dir(*static_files))) + http.HandleFunc("/api/v0/attempt/", attempt) + http.HandleFunc("/api/v0/problem/", problem) if err := http.ListenAndServe(*addr, nil); err != nil { log.Fatal("ListenAndServe:", err) } diff --git a/static/index.html b/static/index.html index 789ecb1..09c0ff9 100644 --- a/static/index.html +++ b/static/index.html @@ -1,9 +1,9 @@ - {{ title }} + Mardson's Math Game - +
@@ -17,7 +17,7 @@
score:
- - + +