added a json handler

This commit is contained in:
sm
2013-05-08 23:41:59 -07:00
parent a8ceec3d6b
commit 97f18f1df2
3 changed files with 10 additions and 3 deletions
+2 -2
View File
@@ -21,8 +21,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)
http.HandleFunc("/api/v0/attempt/", JsonHandler(attempt))
http.Handle("/api/v0/problem/", JsonHandler(problem))
if err := http.ListenAndServe(*addr, nil); err != nil {
log.Fatal("ListenAndServe:", err)
}