Update README.md

This commit is contained in:
StarAppeal
2024-12-11 13:17:36 +01:00
committed by GitHub
parent 265ea5118a
commit a4c46e82f5
+15 -15
View File
@@ -77,12 +77,12 @@ npm run start
## Endpoints ## Endpoints
### WebSocket ### WebSocket
- **Path**: `/websocket` - **Path**: `/api/websocket`
- **Function**: Enables real-time communication between clients and the server. - **Function**: Enables real-time communication between clients and the server.
### REST API ### REST API
#### Authentication #### Authentication
- **POST** `/auth/register` - **POST** `/api/auth/register`
- **Description**: Registers a new user. - **Description**: Registers a new user.
- **Request Body**: - **Request Body**:
```json ```json
@@ -102,7 +102,7 @@ npm run start
} }
``` ```
- **POST** `/auth/login` - **POST** `/api/auth/login`
- **Description**: Logs in a user and generates a JWT. - **Description**: Logs in a user and generates a JWT.
- **Request Body**: - **Request Body**:
```json ```json
@@ -122,7 +122,7 @@ npm run start
``` ```
#### Token Properties #### Token Properties
- **GET** `/jwt/id` - **GET** `/api/jwt/id`
- **Description**: Retrieves the user's ID from the JWT. - **Description**: Retrieves the user's ID from the JWT.
- **Response**: - **Response**:
```json ```json
@@ -131,7 +131,7 @@ npm run start
} }
``` ```
- **GET** `/jwt/username` - **GET** `/api/jwt/api/username`
- **Description**: Retrieves the user's username from the JWT. - **Description**: Retrieves the user's username from the JWT.
- **Response**: - **Response**:
```json ```json
@@ -140,7 +140,7 @@ npm run start
} }
``` ```
- **GET** `/jwt/uuid` - **GET** `/api/jwt/uuid`
- **Description**: Retrieves the user's UUID from the JWT. - **Description**: Retrieves the user's UUID from the JWT.
- **Response**: - **Response**:
```json ```json
@@ -150,7 +150,7 @@ npm run start
``` ```
#### User Management #### User Management
- **GET** `/user` - **GET** `/api/user`
- **Description**: Lists all users. - **Description**: Lists all users.
- **Response**: - **Response**:
```json ```json
@@ -163,7 +163,7 @@ npm run start
] ]
``` ```
- **GET** `/user/me` - **GET** `/api/user/me`
- **Description**: Retrieves details of the currently authenticated user. - **Description**: Retrieves details of the currently authenticated user.
- **Response**: - **Response**:
```json ```json
@@ -174,7 +174,7 @@ npm run start
} }
``` ```
- **PUT** `/user/me/spotify` - **PUT** `/api/user/me/api/spotify`
- **Description**: Updates the user's Spotify information. - **Description**: Updates the user's Spotify information.
- **Request Body**: - **Request Body**:
```json ```json
@@ -193,7 +193,7 @@ npm run start
} }
``` ```
- **PUT** `/user/me/password` - **PUT** `/api/user/me/password`
- **Description**: Updates the user's password. - **Description**: Updates the user's password.
- **Request Body**: - **Request Body**:
```json ```json
@@ -212,7 +212,7 @@ npm run start
} }
``` ```
- **GET** `/user/:id` - **GET** `/api/user/:id`
- **Description**: Retrieves details of a specific user by ID. - **Description**: Retrieves details of a specific user by ID.
- **Response**: - **Response**:
```json ```json
@@ -224,7 +224,7 @@ npm run start
``` ```
#### WebSocket Management #### WebSocket Management
- **POST** `/websocket/broadcast` - **POST** `/api/websocket/broadcast`
- **Description**: Sends a broadcast message to all connected WebSocket clients. - **Description**: Sends a broadcast message to all connected WebSocket clients.
- **Request Body**: - **Request Body**:
```json ```json
@@ -239,7 +239,7 @@ npm run start
- **Response**: - **Response**:
"OK" "OK"
- **POST** `/websocket/send-message` - **POST** `/api/websocket/send-message`
- **Description**: Sends a direct message to a specific WebSocket client. - **Description**: Sends a direct message to a specific WebSocket client.
- **Request Body**: - **Request Body**:
```json ```json
@@ -259,7 +259,7 @@ npm run start
"OK" "OK"
#### Spotify Token Management #### Spotify Token Management
- **GET** `/spotify/token/refresh/:refresh_token` - **GET** `/api/spotify/token/refresh/:refresh_token`
- **Description**: Refreshes a Spotify token using a provided refresh token. - **Description**: Refreshes a Spotify token using a provided refresh token.
- **Response**: - **Response**:
```json ```json
@@ -271,7 +271,7 @@ npm run start
} }
``` ```
- **GET** `/spotify/token/generate/code/:auth_code/redirect-uri/:redirect_uri` - **GET** `/api/spotify/token/generate/code/:auth_code/redirect-uri/:redirect_uri`
- **Description**: Generates a Spotify token using an authorization code and redirect URI. - **Description**: Generates a Spotify token using an authorization code and redirect URI.
- **Response**: - **Response**:
```json ```json