Use generated interface
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
api "code.dlmw.ch/dlmw/qv/internal"
|
||||
"code.dlmw.ch/dlmw/qv/internal/models"
|
||||
"code.dlmw.ch/dlmw/qv/ui"
|
||||
"github.com/justinas/alice"
|
||||
@ -21,8 +22,10 @@ func (app *application) routes() http.Handler {
|
||||
mux.Handle("GET /static/", http.FileServerFS(ui.Files))
|
||||
mux.HandleFunc("GET /election/create", app.createElectionPage)
|
||||
|
||||
mux.HandleFunc("POST /election", app.createElection)
|
||||
mux.HandleFunc("POST /election/{id}/votes", app.createVotes)
|
||||
api.HandlerWithOptions(app, api.StdHTTPServerOptions{
|
||||
BaseRouter: mux,
|
||||
ErrorHandlerFunc: app.badRequestError,
|
||||
})
|
||||
|
||||
standard := alice.New(app.recoverPanic, app.logRequest)
|
||||
return standard.Then(mux)
|
||||
|
Reference in New Issue
Block a user