Add create-election.html

This commit is contained in:
2025-01-13 10:56:36 +01:00
parent 9cc85b9a47
commit 4f50aca3b6
5 changed files with 251 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package main
import (
"code.dlmw.ch/dlmw/qv/internal/models"
"code.dlmw.ch/dlmw/qv/ui"
"github.com/justinas/alice"
"log/slog"
"net/http"
@ -17,6 +18,9 @@ type application struct {
func (app *application) routes() http.Handler {
mux := http.NewServeMux()
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)