See Moozdzn/society_dashboard for its intended usage This resource is designed to offload the task of generating CSV files from the game server, thereby reducing server stress. It provides a download link that can be opened in the player's browser.
-
GET /api/society/[name]
- Description: This endpoint retrieves detailed information about a specific society, identified by its name. It queries the database for roles and characters associated with the society, formats the data, and caches it as a CSV file. If the data is already cached, it returns a link to download the CSV file.
-
GET /api/download/[file]
- Description: This endpoint allows downloading of a CSV file that contains cached data for a specific society or log. It checks if the file is available and streams it to the client. If the file is expired, it deletes the file from the server.
-
GET /api/logs/[name]
- Description: This endpoint fetches logs for a specific society within a given date range. It generates a CSV file with the logs and provides a link to download it. The logs are cached for a limited time.
- Fetching Society Details: Use
/api/society/[name]
to get detailed information about a specific society. - Downloading Files: Use
/api/download/[file]
to download CSV files generated by the system. - Fetching Logs: Use
/api/logs/[name]
to retrieve logs for a society within a specified date range.
- Ensure that the
name
parameter is provided when accessing society-specific endpoints. - The
from
andto
parameters in the logs endpoint should be valid timestamps. - Cached files are automatically deleted after a certain period to free up server space.
-
Clone the repo
-
Install NPM packages
npm install
-
Run locally
npm run serve