Commit Graph

3 Commits

Author SHA1 Message Date
da6f8b4519 Add input validation
Input validation uses Malli coercion. Sadly enough, email is validated
with a regexp.
2026-01-31 13:39:34 +01:00
b9ae9a8b56 Check 'POST /items' payload is application/json
This commit adds a middleware function that checks any POST endpoint is
called with Content-Type: application/json. Returns `HTTP 415
Unsupported Media Type` if this is not the case.

TODO: this commit does not check that the payload is actually
well-formed JSON. If the payload is *not* valid JSON, muutaja will fail,
which will result in an `HTTP 500 Server error`.
2026-01-31 13:37:20 +01:00
c278633c66 Initial commit
This initial version is purposely extremily limited:
* `GET /ahoy` endpoint, just to check the server is alive
* `GET /items` endpoint, always returns the same item
* `POST items` endpoint, checks and print request payload, no
  persistance
* calling any other route defaults to a 404
2026-01-31 13:37:16 +01:00