From a9dd8088deed72724d42923103a995a59aca5f54 Mon Sep 17 00:00:00 2001 From: Erin Nova Date: Sat, 17 Jul 2021 15:59:58 -0400 Subject: [PATCH] Update API docs --- README.md | 6 +++++- src/auth.rs | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index aac5071..0c38579 100644 --- a/README.md +++ b/README.md @@ -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//` Register the username with the pin provided if it doesn't already exist +`POST /api/register///` Register the username with the pin provided if it doesn't already exist `GET /api/users/` 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////` Change a users pin/name +`GET /api/about/name/` Get's the name of a user, probably just for checking if they exist + +`GET /api/about/pronouns/` 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. diff --git a/src/auth.rs b/src/auth.rs index a82beb0..eb06aea 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -8,13 +8,17 @@ use serde_json::Result; pub fn index() -> &'static str { "API Info: - `POST /api/register//` Register the username with the pin provided if it doesn't already exist + `POST /api/register///` Register the username with the pin provided if it doesn't already exist `GET /api/users/` Check if the user exists `GET /api/users//` Check if the user exists, and if the pin provided matches - `POST /api/users/change////` Change a users name and/or pin" + `POST /api/users/change////` Change a users name and/or pin + + `GET /api/about/name/` Get the name of a user + + `GET /api/about/pronouns/` Get the pronouns of a user" } /* // The output is wrapped in a Result to allow matching on errors