From 97bc774cac822a725d39a9d72dec10ce04394742 Mon Sep 17 00:00:00 2001 From: Curly Bryce Date: Wed, 3 Jul 2024 15:06:33 -0600 Subject: Docs in readme --- README.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ TODO | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..e46a9a7 --- /dev/null +++ b/README.md @@ -0,0 +1,47 @@ +## Methods +- GET `/` + - Response + - 200 Ok + - HTML `"This is a POKO server"` +- GET `/user/` + - Response + - 200 Ok + - JSON `{"name": "NAME", "id": "ID"}` + - 404 Not Found + - JSON `"Not Found"` +- GET `/user/by_name/` + - Response + - 200 Ok + - JSON `[{"name": "NAME", "id": "ID"}, ...]` + - 400 Not Found + - JSON `"Not Found"` +- GET `/user/all` + - Same as GET `/user/by_name/` +- POST `/user/register` + - Request + - JSON `{"name":"NAME", "password": "PASSWORD", "id": "ID"}` + - ID is optional + - Response + - 201 Created + - 400 Bad Request + - JSON `"UID is taken"` + - 500 Internal Server Error + - JSON `"No available UID left"` + - JSON `"UID length is incorrect"` + - JSON `"UID String is not valid"` +- POST `/user` + - Request + - JSON `{"id": "ID", "password": "PASSWORD", "clientid": "CLIENT_ID"}` + - Response + - 200 Ok + - JSON `"SESSION_KEY"` + - The session key is needed for any authenticated action + - 401 Unauthorized + - JSON `"Could not login"` +- POST `/user/logout` + - Request + - JSON `{"id": "ID", "session": "SESSION_KEY"}` + - Response + - 200 Ok + - 401 Unauthorized + - JSON `"Not Authenticated"` \ No newline at end of file diff --git a/TODO b/TODO index 95a564f..2aea99f 100644 --- a/TODO +++ b/TODO @@ -3,4 +3,4 @@ Deleting of users Transfers Token Values Token Stock Prices (Values) -Docs \ No newline at end of file +Config \ No newline at end of file -- cgit v1.2.3