Add help page explaining how to create a new quiz

This commit is contained in:
Vojtěch Káně
2021-07-03 16:42:36 +02:00
parent b0e8a43331
commit 46ccc879da
4 changed files with 31 additions and 1 deletions

View File

@@ -56,6 +56,10 @@ func (app *application) home(w http.ResponseWriter, r *http.Request, formData ho
app.render(w, r, "home.page.tmpl.html", td)
}
func (app *application) help(w http.ResponseWriter, r *http.Request, params httprouter.Params) {
app.render(w, r, "help.page.tmpl.html", nil)
}
func (app *application) play(w http.ResponseWriter, r *http.Request, params httprouter.Params) {
if err := r.ParseForm(); err != nil {
app.clientError(w, http.StatusBadRequest)

View File

@@ -111,6 +111,7 @@ func main() {
mux.GET("/template", app.downloadTemplate)
mux.POST("/game", app.createGame)
mux.GET("/quiz/:gameUid", app.showGame)
mux.GET("/help", app.help)
mux.GET("/ws/:playerUid", app.processWebSocket)