Module: routes/eventRoutes

Routes for Event Management in Satoshi Showdown. This module defines the Express routes for handling event-related operations such as creating, updating, deleting, and retrieving events. Each route is associated with a specific controller function to handle the request. These routes are integral to the application's RESTful API, allowing clients to interact with event data stored in the backend system.

Source:

Requires

Methods

(inner) delete/delete(path, middleware)

DELETE route to remove an event from the system based on its ID. This route utilizes the handleDeleteEvent controller to process the event deletion request. The event ID to delete is expected as a URL parameter.

Parameters:
Name Type Description
path string

Express path with event ID as a parameter.

middleware callback

Express middleware (controller function).

Source:

(inner) get/get(path, middleware)

GET route to retrieve detailed information about a specific event by its ID. This route uses the handleGetEvent controller to fetch and return the requested event data. The event ID is expected as a URL parameter, and the route returns the full details of the specified event if found.

Parameters:
Name Type Description
path string

Express path with event ID as a parameter.

middleware callback

Express middleware (controller function).

Source:

(inner) get/getAll(path, middleware)

GET route to retrieve a list of all events in the system. This route calls the handleGetAllEvents controller to fetch and return data for all events. It is typically used to display an overview of events or for administrative purposes.

Parameters:
Name Type Description
path string

Express path.

middleware callback

Express middleware (controller function).

Source:

(inner) post/awardWinner(path, middleware)

POST route to award the winner of an event. This route is used to process the prize distribution for the winner of a specified event.

Parameters:
Name Type Description
path string

Express path with event ID as a parameter.

middleware callback

Express middleware (controller function).

Source:

(inner) post/create(path, middleware)

POST route to create a new event in the system. This route invokes the handleCreateEvent controller to process the event creation request. It expects the event data to be provided in the request body, typically including details like event name, date, location, and other relevant information.

Parameters:
Name Type Description
path string

Express path.

middleware callback

Express middleware (controller function).

Source:

(inner) post/join(path, middleware)

POST route for a user to join an event. Expects event and user IDs in the request body.

Parameters:
Name Type Description
path string

Express path.

middleware callback

Express middleware (controller function).

Source:

(inner) post/outcome(path, middleware)

POST route to determine the outcome of an event. This route calls the handleDetermineOutcome controller to process the event outcome determination. The event ID is expected as a URL parameter.

Parameters:
Name Type Description
path string

Express path with event ID as a parameter.

middleware callback

Express middleware (controller function).

Source:

(inner) post/settle(path, middleware)

POST route to settle an event. Expects the event ID as a URL parameter.

Parameters:
Name Type Description
path string

Express path with event ID as a parameter.

middleware callback

Express middleware (controller function).

Source:

(inner) post/vote(path, middleware)

POST route to cast a vote for a user. Expects the user ID and vote data in the request body.

Parameters:
Name Type Description
path string

Express path.

middleware callback

Express middleware (controller function).

Source:

(inner) put/update(path, middleware)

PUT route to update an existing event identified by its ID. This route calls the handleUpdateEvent controller to handle the event update request. The event ID is expected as a URL parameter, and the updated event data should be provided in the request body.

Parameters:
Name Type Description
path string

Express path with event ID as a parameter.

middleware callback

Express middleware (controller function).

Source: