generated from ElnuDev/go-project
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
428 B
22 lines
428 B
package api
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"git.elnu.com/ElnuDev/jichanorg/httputils"
|
|
. "git.elnu.com/ElnuDev/jichanorg/shiritori/clients"
|
|
)
|
|
|
|
func GenerateApiSubmit(clients *ClientSet) httputils.Handler {
|
|
return httputils.GenerateHandler(
|
|
"",
|
|
func(w http.ResponseWriter, r *http.Request) bool {
|
|
r.ParseMultipartForm(0)
|
|
clients.BroadcastWord(r.FormValue("word"))
|
|
return true
|
|
},
|
|
nil,
|
|
[]string{http.MethodPost},
|
|
)
|
|
}
|