API server for coding test for a front-end engineer.
Prerequisites:
To start working:
-
Clone the project
git clone https://github.com/vasmik/todo-test.git
-
Start API server:
cd todo-test docker-compose up
-
API is up and running on http://localhost:8080/api
-
See the API specification on https://app.swaggerhub.com/apis/vasmik/todo-public_api/1.0.0
-
Use the following auth credentials:
user1
/P@ssw0rd1
To check if service works:
-
Login:
curl -X POST -u user1:P@ssw0rd1 http://localhost:8080/api/auth/#
output:
{"apiKey":"XDaPMouI4SXOGfcTFVQxQraXwOLtjdbAfH5VIFsbUklvjtoc3O0ZToUQLUJ1-SWj"}
-
Use the token to get lists:
curl -H "Authorization: Bearer XDaPMouI4SXOGfcTFVQxQraXwOLtjdbAfH5VIFsbUklvjtoc3O0ZToUQLUJ1-SWj" http://localhost:8080/api/lists
output:
[{"id":1,"name":"User 1 TODO list 1","tasks":2},{"id":11,"name":"User 1 TODO list 2","tasks":1}]