A clojure HTTP Server. This application use a database on memory and don't have any data validation (schema).
To start the app, follow de instructions bellow:
clj -m simple-http-server.core arg1
- arg1: App environment. Must be one of "prod" "test" "dev"
- Build docker image
make build_app
- Run docker container
make run_app_container
If you want to see other operations, run make
or make help
Name | Default | Description |
---|---|---|
APP_ENV | "prod" | App environment. If "dev" or "test" was choosen, the app will insert mock data on database |
SERVER_PORT | "3000" | Which port will be used by the server |
List all persons
Request example:
curl --request GET \
--url http://localhost:3030/person
Get a person by id
curl --request GET \
--url http://localhost:3030/person/341234=13kbsadf89132=1234obds07f1
Insert a new person on database.
curl --request POST \
--url http://localhost:3030/person \
--header 'content-type: application/json' \
--data '{"name" : "Mary Mine",
"age": 23}'
Update a person by id
curl --request PUT \
--url http://localhost:3030/person/b3456d4a-29b7-42d2-b742-65fadf6b6f83 \
--header 'content-type: application/json' \
--data '{"age": 100}'
Delete a person by id
curl --request DELETE \
--url http://localhost:3030/person/b3456d4a-29b7-42d2-b742-65fadf6b6f83