diff --git a/README.md b/README.md index d5c20323667f70ef1b1ae1741fc64d5f90eac452..64c9843c424ef58993901e2dc7e65ac29d58d83e 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,49 @@ yarn install ## Usage To run this website locally execute `yarn start` in the working directory. + +## API + +`GET /users => [Object]` -> Lists all users + +`GET /users/id => Object` -> Get the info about the user with asked id + +`GET /boards => [Object]` -> Lists all boards + +`GET /boards/id => Object` -> Get the info about the board with asked id + +`GET /messages?board=id => [Object]` -> Get the messages from the board with asked id + +To post a message from specified user on specified board: + +```json +POST /messages +body: +{ + content: "blabla", + userId: 42, + boardId: 1 +} +``` + +To register a new user (returns the user): + +```json +POST /users => Object +body: +{ + username: "blabla", + paswword: "verysecure" +} +``` + +To login an user (returns a list containing the matching users): + +```json +POST /login => [Object] +body: +{ + username: "blabla", + paswword: "verysecure" +} +```