func submitPage(w http.ResponseWriter, r *http.Request) { msg := r.FormValue("msg") id := db.AddMessage(msg) w.Header().Set("Location", "/"+string(id)) w.WriteHeader(301) fmt.Fprint(w, "/"+id) }
func submitAsync(w http.ResponseWriter, r *http.Request) { msg := r.FormValue("msg") id := db.AddMessage(msg) fmt.Fprint(w, "/"+id) }