Here's the documentation for the API endpoints in your application:
GET /:
This endpoint serves the HTML content for the root of the application.
Response:
Status Code: 200 (OK)
Content Type: text/html
GET /static/:
This endpoint serves static resources, such as CSS or JavaScript files.
Response:
Status Code: 200 (OK)
Content Type: Depends on the requested resource (e.g., text/css, application/javascript)
POST /api/users:
This endpoint allows the creation of a new user.
Content Type: application/json
Body: User object
Status Code: 201 (Created)
Content Type: application/json
Body: The ID of the newly created user
GET /api/users/{id}:
This endpoint retrieves user information by providing the user's ID.
Path Parameter: id (integer)
- ID of the user to retrieve
Status Code: 200 (OK) if the user exists
Status Code: 404 (Not Found) if the user does not exist
Content Type: application/json
Body: User object
PUT /api/users/{id}:
This endpoint allows updating an existing user's information.
Path Parameter: id (integer) - ID of the user to update
Content Type: application/json
Body: Updated User object
Status Code: 200 (OK)
DELETE /api/users/{id}:
This endpoint allows the deletion of a user by providing the user's ID.
Path Parameter: id (integer) - ID of the user to delete
Status Code: 200 (OK)
POST /api/users/login:
This endpoint handles user login and authentication.
Content Type: application/json
Body: UserCredentials object
Status Code: 200 (OK) if login is successful
Status Code: 401 (Unauthorized) if login fails
Status Code: 400 (Bad Request) if the tenant is not found
Content Type: text/plain
Body: "Login successful" or "Login failed" as appropriate
POST /api/tenants:
This endpoint allows the creation of a new tenant.
Content Type: application/json
Body: ExposedTenant object
Content Type: application/json
Body: The ID of the newly created tenant
GET /api/tenants:
This endpoint retrieves a list of all tenants.
Status Code: 200 (OK)
Content Type: application/json
Body: List of tenants
POST /api/tenants/switch:
This endpoint handles switching the current tenant for a user.
Content Type: application/json
Body: Tenant ID (integer)
Status Code: 200 (OK)
GET /api/tenants/current/users:
This endpoint retrieves users for the current tenant.
Status Code: 200 (OK) if the user is authenticated
Status Code: 401 (Unauthorized) if login fails
Content Type: application/json
Body: List of users