diff options
| author | mo khan <mo@mokhan.ca> | 2025-04-11 11:58:22 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-04-11 11:58:22 -0600 |
| commit | c3a5cae20e431770a954aa1faf807b01fe1666c6 (patch) | |
| tree | ac106dc26002fe5193d0b3fe174dbc37fa4cab38 /pkg/web/server.go | |
| parent | f54c7796fa23f209726a615fa03787fe6c23b07f (diff) | |
refactor: use content-type negotiation based on accept header
Diffstat (limited to 'pkg/web/server.go')
| -rw-r--r-- | pkg/web/server.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/pkg/web/server.go b/pkg/web/server.go index e553920..c87873c 100644 --- a/pkg/web/server.go +++ b/pkg/web/server.go @@ -3,7 +3,6 @@ package web import ( "net/http" - "github.com/google/jsonapi" "github.com/xlgmokha/x/pkg/serde" "gitlab.com/mokhax/sparkled/pkg/db" ) @@ -28,8 +27,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { case "/sparkles.json": switch r.Method { case "GET": - w.Header().Set("Content-Type", jsonapi.MediaType) - serde.ToJSONAPI(w, s.db.All()) + serde.ToHTTP(w, r, s.db.All()) } default: s.fileserver.ServeHTTP(w, r) |
