Update API docs

pull/5/head
~erin 2021-07-17 15:59:58 -04:00
parent 7fa849edf9
commit a9dd8088de
Signed by: erin
GPG Key ID: DA70E064A8C70F44
2 changed files with 11 additions and 3 deletions

View File

@ -5,7 +5,7 @@ Send it the unhashed username and pin, and it'll store it in the `users.json` fi
## API Documentation
`POST /api/register/<name>/<pin>` Register the username with the pin provided if it doesn't already exist
`POST /api/register/<name>/<pin>/<pronouns>` Register the username with the pin provided if it doesn't already exist
`GET /api/users/<name>` Check if the user exists
@ -13,6 +13,10 @@ Send it the unhashed username and pin, and it'll store it in the `users.json` fi
`POST /api/users/change/<name>/<pin>/<new-name>/<new-pin>` Change a users pin/name
`GET /api/about/name/<name>` Get's the name of a user, probably just for checking if they exist
`GET /api/about/pronouns/<name>` Get's the pronouns of a user
## Chat Planning
Clientside js will register & check login of users, if login is correct will ask for a random token.

View File

@ -8,13 +8,17 @@ use serde_json::Result;
pub fn index() -> &'static str {
"API Info:
`POST /api/register/<name>/<pin>` Register the username with the pin provided if it doesn't already exist
`POST /api/register/<name>/<pin>/<pronouns>` Register the username with the pin provided if it doesn't already exist
`GET /api/users/<name>` Check if the user exists
`GET /api/users/<name>/<pin>` Check if the user exists, and if the pin provided matches
`POST /api/users/change/<name>/<pin>/<new-name>/<new-pin>` Change a users name and/or pin"
`POST /api/users/change/<name>/<pin>/<new-name>/<new-pin>` Change a users name and/or pin
`GET /api/about/name/<name>` Get the name of a user
`GET /api/about/pronouns/<name>` Get the pronouns of a user"
}
/*
// The output is wrapped in a Result to allow matching on errors