Add POST /election

This commit is contained in:
2024-12-27 18:03:46 +01:00
parent 80d936af6e
commit 5c784f491d
7 changed files with 88 additions and 193 deletions

15
cmd/web/routes.go Normal file
View File

@ -0,0 +1,15 @@
package main
import (
"github.com/justinas/alice"
"net/http"
)
func (app *application) routes() http.Handler {
mux := http.NewServeMux()
mux.HandleFunc("POST /election", app.createElection)
standard := alice.New(app.recoverPanic, app.logRequest)
return standard.Then(mux)
}