Benjamin Sigonneau 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
2026-01-31 13:37:16 +01:00
2026-01-31 13:37:16 +01:00
2026-01-31 13:37:16 +01:00
2026-01-31 13:37:16 +01:00

Yohoho - A take-home assignment for HolidayPirates

This is my take on the take-home assignment I was given for the Backend Engineer position at HolidayPirates.

The goal is to implement a very small REST API in Clojure. That API provides two endpoints :

  • POST /items: creates an item
  • GET /items: returns the list of items

Usage

This project uses Leiningen. Assuming you already have Leiningen installed, running the API should be as easy as cloning the repo and issuing lein run. By default, the server listens on port 3000.

Library choices

  • reitit: for handling routes
  • jetty: web server
  • muuntaja: JSON handling

The following links proved more than useful when working on this assignment:

Description
No description provided
Readme WTFPL 104 KiB
Languages
Clojure 100%