Description
Over the course of development, we have created various dummy data arrays scattered directly inside our route controllers.
This makes the codebase messy and hard to transition when we finally connect a real PostgreSQL database.
We need to extract all hardcoded arrays (tokens, history, leaderboards) into separate files within a mock-db folder.
The controllers should simply require() these files, simulating an actual database query.
Requirements
Description
Over the course of development, we have created various dummy data arrays scattered directly inside our route controllers.
This makes the codebase messy and hard to transition when we finally connect a real PostgreSQL database.
We need to extract all hardcoded arrays (tokens, history, leaderboards) into separate files within a
mock-dbfolder.The controllers should simply
require()these files, simulating an actual database query.Requirements
mock-db/directory at the root of the project.mock-db/tokens.jsandmock-db/leaderboard.jsand move the dummy arrays there.module.exports.