http://localhost:3000
- Endpoint:
/register - Method:
POST - Description: Registers a new client with a unique name. Returns an error if the name already exists.
Request Body:
{
"name": "someName"
}Response:
- 201 Created:
{
"id": 1,
"name": "someName",
"enter": false,
"qrPresent": false,
"exhibitionSection": null
}- 400 Bad Request:
{
"error": "Name already exists"
}- 500 Internal Server Error:
{
"error": "Error message"
}- Endpoint:
/qr-scan - Method:
POST - Description: Updates the enter status of a client. If enter is false, sets it to true and returns
entered: false. If enter is true, returnsentered: true.
Request Body:
{
"id": 1
}Response:
- 200 OK (if enter was previously false):
{
"entered": false
}- 200 OK (if enter was previously true):
{
"entered": true
}- 404 Not Found:
{
"error": "Client not found"
}- 500 Internal Server Error:
{
"error": "Error message"
}- Endpoint:
/move - Method:
POST - Description: Moves a client to a specified exhibition section (A, B, C, or D).
Request Body:
{
"id": 1,
"section": "A"
}Response:
- 200 OK:
{
"section": "A"
}- 400 Bad Request:
{
"error": "Invalid section"
}- 404 Not Found:
{
"error": "Client not found"
}- 500 Internal Server Error:
{
"error": "Error message"
}- Endpoint:
/login - Method:
POST - Description: Returns the ID of the client with the specified name.
Request Body:
{
"name": "someName"
}Response:
- 200 OK:
{
"id": 1
}- 404 Not Found:
{
"error": "Name not found"
}- 500 Internal Server Error:
{
"error": "Error message"
}Register a New Client
curl -X POST http://localhost:3000/register -H "Content-Type: application/json" -d '{"name": "John Doe"}'QR Scan
curl -X POST http://localhost:3000/qr-scan -H "Content-Type: application/json" -d '{"id": 1}'Move Client to Section
curl -X POST http://localhost:3000/move -H "Content-Type: application/json" -d '{"id": 1, "section": "B"}'Login
curl -X POST http://localhost:3000/login -H "Content-Type: application/json" -d '{"name": "John Doe"}'