16 lines
284 B
Go
16 lines
284 B
Go
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)
|
|
}
|