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
30 lines
891 B
Markdown
30 lines
891 B
Markdown
# 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
|
|
|
|
## 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>
|