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 @@
-