summaryrefslogtreecommitdiff
path: root/examples/basic.go
blob: 856d682608b0653ef9d85902aa6627cac45c3cdc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package examples

import (
	"log/slog"
	"net/http"
)

// Big bungus function here!
//
//hh:route GET /admin/users
func adminUsersForm(w http.ResponseWriter, r struct {
	r       *http.Request
	search  string `hh:"form"`
	year    int    `hh:"optional,form"`
	offset  int    `hh:"form"`
	nextURL string `hh:"cookie,logout_next_url"`
}) {
	_, _ = w.Write([]byte("ahahaha"))
	slog.Info("get admin users form", "search", r.search, "offset", r.offset, "next-url", r.nextURL)
}