78948fd017adee3154f3fcfa8b22f44c18223b94
GET /item/:id endpoint
This new endpoint was so easy to add, it would have been a shame not to do it. Besides, it makes sense since the reponse from `POST /items` provided a `Location` header for the newly created item.
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 itemGET /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 routesjetty: web servermuuntaja: JSON handlingnext.jdbc: database interface (SQLite)
Documentation links
The following links proved more than useful when working on this assignment:
- https://practical.li/clojure-web-services/building-api/
- https://github.com/metosin/reitit/blob/master/doc/ring/content_negotiation.md
- https://ostash.dev/posts/2021-08-22-data-validation-in-clojure/
- https://clojurecivitas.github.io/malli/elements_of_malli.html
- https://github.com/metosin/reitit/blob/master/doc/coercion/malli_coercion.md
- https://cljdoc.org/d/com.github.seancorfield/next.jdbc/1.3.1086/doc/getting-started
Languages
Clojure
100%