This is the API documentation for the backend server.
- Endpoint:
POST /api/signup
- Description: Registers a new user.
- Body Parameters:
email
: User's email address (string)password
: User's password (string)
- Returns: User object
- Endpoint:
POST /api/login
- Description: Logs in a user.
- Body Parameters:
email
: User's email address (string)password
: User's password (string)
- Returns: User object with access token
- Endpoint:
POST /api/reset-password
- Description: Sends a password reset email to the user.
- Body Parameters:
email
: User's email address (string)
- Returns: Success message
- Endpoint:
POST /api/reset-password/:token
- Description: Updates the user's password using the reset token.
- URL Parameters:
token
: Password reset token (string)
- Body Parameters:
password
: New password (string)
- Returns: Success message
- Endpoint:
POST /api/verify-token/:token
- Description: Verifies the user account using the verification token.
- URL Parameters:
token
: Verification token (string)
- Returns: Success message
- Endpoint:
GET /api/user
- Description: Retrieves the details of the authenticated user.
- Returns: User object
- Endpoint:
PUT /api/user
- Description: Updates the details of the authenticated user.
- Body Parameters: User details to be updated
- Returns: Updated user object
- Endpoint:
POST /api/user/wishlist
- Description: Creates a wishlist item for the authenticated user.
- Body Parameters:
locationId
: ID of the location to be added to the wishlist (string)
- Returns: Wishlist item object
- Endpoint:
GET /api/user/wishlist
- Description: Retrieves the wishlist items of the authenticated user.
- Returns: Wishlist items array
- Endpoint:
DELETE /api/user/wishlist/:locationId
- Description: Deletes a wishlist item for the authenticated user.
- URL Parameters:
locationId
: ID of the location to be removed from the wishlist (string)
- Returns: Success message
- Endpoint:
POST /api/location
- Description: Creates a new location.
- Body Parameters: Location details
- Returns: Created location object
- Endpoint:
GET /api/location
- Description: Retrieves all locations.
- Returns: Array of location objects
- Endpoint:
GET /api/location/search
- Description: Retrieves locations owned by a specific user.
- Query Parameters:
ownerId
: ID of the owner (string)
- Returns: Array of location objects
- Endpoint:
GET /api/location/:locationId
- Description: Retrieves a location by ID.
- URL Parameters:
locationId
: ID of the location (string)
- Returns: Location object
- Endpoint:
DELETE /api/location/:locationId
- Description: Deletes a location.
- URL Parameters:
locationId
: ID of the location to be deleted (string)
- Returns: Success message
- Endpoint:
POST /api/location/:locationId/menu
- Description: Adds a menu to a location.
- URL Parameters:
locationId
: ID of the location (string)
- Body Parameters: Menu details
- Returns: Created menu object
- Endpoint:
GET /api/location/:locationId/menu
- Description: Retrieves all menus of a location.
- URL Parameters:
locationId
: ID of the location (string)
- Returns: Array of menu objects
- Endpoint:
PUT /api/location/:locationId/menu/:menuId
- Description: Updates a menu of a location.
- URL Parameters:
locationId
: ID of the location (string)menuId
: ID of the menu to be updated (string)
- Body Parameters: Updated menu details
- Returns: Updated menu object
- Endpoint:
DELETE /api/location/:locationId/menu/:menuId
- Description: Deletes a menu from a location.
- URL Parameters:
locationId
: ID of the location (string)menuId
: ID of the menu to be deleted (string)
- Returns: Success message
- Endpoint:
POST /api/location/:locationId/facility
- Description: Creates a facility for a location.
- URL Parameters:
locationId
: ID of the location (string)
- Body Parameters: Facility details
- Returns: Created facility object
- Endpoint:
GET /api/location/:locationId/facility
- Description: Retrieves all facilities of a location.
- URL Parameters:
locationId
: ID of the location (string)
- Returns: Array of facility objects
- Endpoint:
PUT /api/location/:locationId/facility/:facilityId
- Description: Updates a facility of a location.
- URL Parameters:
locationId
: ID of the location (string)facilityId
: ID of the facility to be updated (string)
- Body Parameters: Updated facility details
- Returns: Updated facility object
- Endpoint:
DELETE /api/location/:locationId/facility/:facilityId
- Description: Deletes a facility from a location.
- URL Parameters:
locationId
: ID of the location (string)facilityId
: ID of the facility to be deleted (string)
- Returns: Success message
- Endpoint:
POST /api/location/:locationId/galery
- Description: Adds an image to the gallery of a location.
- URL Parameters:
locationId
: ID of the location (string)
- Body Parameters: Image file
- Returns: Success message
- Endpoint:
POST /api/location/:locationId/review
- Description: Creates a review for a location.
- URL Parameters:
locationId
: ID of the location (string)
- Body Parameters: Review details
- Returns: Created review object
- Endpoint:
GET /api/location/:locationId/review
- Description: Retrieves all reviews of a location.
- URL Parameters:
locationId
: ID of the location (string)
- Returns: Array of review objects
- Endpoint:
PUT /api/location/:locationId/review
- Description: Updates a review of a location.
- URL Parameters:
locationId
: ID of the location (string)
- Body Parameters: Updated review details
- Returns: Updated review object
- Endpoint:
DELETE /api/location/:locationId/review
- Description: Deletes a review from a location.
- URL Parameters:
locationId
: ID of the location (string)
- Returns: Success message
- Endpoint:
*
- Description: Handles invalid routes.
- Returns: Error message
- Endpoint:
/*
- Description: Serves the frontend index.html file.
- Returns: Frontend index.html file