/rest-api-reitit

Simply naive Clojure REST API service using reitit to "manage" users.

Primary LanguageClojure

rest-api-reitit

Example: simply naive Clojure REST API service using reitit to "manage" users.

The service API schema and back end Clojure code are using different case letter convention: The API schema is using camelCase (popular convention in many programing languages such as JavaScript) and the backend Clojure code is using kebab-case (https://github.com/bbatsov/clojure-style-guide#lisp-case).

Read more

Read more about the this repository in this medium post

Try it out

Clone this repo into your local hard drive and start the HTTP service:

> lein repl
(start)

Test the REST API endpoints using Swagger UI from http://localhost:3000/api-docs, or from the command line using httpie:

# list all users
http GET :3000/v1/users
http GET :3000/v1/users lastName==second

# add new user
http POST :3000/v1/users userName=new-user firstName=new lastName=user

# get specific user
http DELETE :3000/v1/users/2

# update specific user
http PUT :3000/v1/users/2 userName=user-2 firstName=new-fname lastName=new-lname

# delete specific user
http DELETE :3000/v1/users/2