Example #1
0
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)
}
Example #2
0
func submitAsync(w http.ResponseWriter, r *http.Request) {
	msg := r.FormValue("msg")
	id := db.AddMessage(msg)
	fmt.Fprint(w, "/"+id)
}