diff options
| author | mo khan <mo@mokhan.ca> | 2025-04-12 18:11:05 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-04-12 18:11:05 -0600 |
| commit | 0bef608297d7def2a18d054e7230fe0e0a3710a7 (patch) | |
| tree | 93a8ec34baa695705832ace22266e1f13cb9e64e /app/controllers/sparkles/controller.go | |
| parent | 54715831a2d307390c05214b6ae8bc721ade6680 (diff) | |
Diffstat (limited to 'app/controllers/sparkles/controller.go')
| -rw-r--r-- | app/controllers/sparkles/controller.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/sparkles/controller.go b/app/controllers/sparkles/controller.go index 365184f..f00f40c 100644 --- a/app/controllers/sparkles/controller.go +++ b/app/controllers/sparkles/controller.go @@ -16,6 +16,11 @@ func New(db db.Repository) *Controller { return &Controller{db: db} } +func (c *Controller) MountTo(mux *http.ServeMux) { + mux.HandleFunc("GET /sparkles", c.Index) + mux.HandleFunc("POST /sparkles", c.Create) +} + func (c *Controller) Index(w http.ResponseWriter, r *http.Request) { serde.ToHTTP(w, r, c.db.All()) } |
