aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorCurly Bryce <curlybryce@protonmail.com>2024-07-03 15:06:33 -0600
committerCurly Bryce <curlybryce@protonmail.com>2024-07-03 15:06:33 -0600
commit97bc774cac822a725d39a9d72dec10ce04394742 (patch)
treedbf22e71909df9b53c8b79e21bbdd1f1fdd21668 /README.md
parent8c68b01bb9a28ada388187c17fa9b28a115e7cc7 (diff)
downloadpoko_server-97bc774cac822a725d39a9d72dec10ce04394742.tar.gz
poko_server-97bc774cac822a725d39a9d72dec10ce04394742.tar.bz2
poko_server-97bc774cac822a725d39a9d72dec10ce04394742.zip
Docs in readme
Diffstat (limited to 'README.md')
-rw-r--r--README.md47
1 files changed, 47 insertions, 0 deletions
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/<id>`
+ - Response
+ - 200 Ok
+ - JSON `{"name": "NAME", "id": "ID"}`
+ - 404 Not Found
+ - JSON `"Not Found"`
+- GET `/user/by_name/<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