feat: a lot

i did a lot of work, and i also forgot to add commits regularly. I added the controller routes to create and delete controllers, improved error handling und improved the authentification process. I'm gonna add an websocket next and then I should be hopefully done with the foundations of this project. I may also add anviewControllers route which respons with every available controller
This commit is contained in:
Siesta
2025-07-20 18:31:38 +02:00
parent 25bd0cc0c8
commit 57592b4987
10 changed files with 138 additions and 63 deletions
+8 -8
View File
@@ -1,4 +1,4 @@
# Laterna
# 🛋️ Laterna (Server)
## 🛜 API Documentation
@@ -40,26 +40,26 @@ Authorization: <token>
#### Create a new controller
```bash
$ curl -X POST http://your-server.com/api/v1/controllers \
-H "Authorization: $TOKEN"
-H "Authorization: $TOKEN"
```
Respons with the newly assigned ID
Response with the newly assigned ID. The ID will always be the next available one
#### Delete an controller
```bash
$ curl -X DELETE localhost:8080/api/v1/controllers \
-H "Authorization: $TOKEN" \
-d '{"ID": 1}'
-H "Authorization: $TOKEN" \
-d '{"ID": 1}'
```
#### Get the current color of an controller
```bash
$ curl -X GET localhost:8080/api/v1/colors/1 \
-H "Authorization: $TOKEN"
-H "Authorization: $TOKEN"
```
#### Set the color of an controller
```bash
$ curl -X PUT localhost:8080/api/v1/colors/1 \
-H "Authorization:$TOKEN" \
-d '{"Color": "#C2C342"}'
-H "Authorization:$TOKEN" \
-d '{"Color": "#C2C342"}'
```