added a json handler
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user