From 6800d4f07e26caba0f11ac2fbdfa1eb332191aee Mon Sep 17 00:00:00 2001 From: Minzkraut Date: Sun, 24 Apr 2022 02:06:33 +0200 Subject: [PATCH] Add instructions and endpoint documentation to README.md --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 0135b18..b0eff32 100644 --- a/README.md +++ b/README.md @@ -1 +1,24 @@ # Bullet Hell Jam 2022 scoreboard server + +## Run the server +Edit .env (and docker-compose ports if necessary) +and run +``` +$ docker-compose up +``` + +## Initialize database +Connect to DB using specified root credentials +Execute schema.sql to create tables and fields + +Create new user `scoreboard` with the specified password and grant permissions `select, insert` on `scoreboard` table + +## Endpoints +- /scores + - GET: returns all scores in descending order (LIMIT 10) + - POST: inserts a new score (Params: username, score, additional_data) + +The endpoint takes content of type `application/x-www-form-urlencoded` + - `username` String of length <= 5 + - `score` Integer + - `additional_data` String, optional (inteneded for potential metadata)