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.
21 lines
406 B
21 lines
406 B
2 years ago
|
package api
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
|
||
|
"git.elnu.com/ElnuDev/shiritori-go/httputils"
|
||
|
. "git.elnu.com/ElnuDev/shiritori-go/shiritori"
|
||
|
)
|
||
|
|
||
|
func GenerateApiSubmit(clients *ClientSet) httputils.Handler {
|
||
|
return httputils.GenerateHandler(
|
||
|
"",
|
||
|
func(w http.ResponseWriter, r *http.Request) {
|
||
|
r.ParseMultipartForm(0)
|
||
|
clients.BroadcastWord(r.FormValue("word"))
|
||
|
},
|
||
|
nil,
|
||
|
[]string{http.MethodPost},
|
||
|
)
|
||
|
}
|