By default, runs on port 5000. Check settings.js
and services/ddhq.js
in the other repo to make sure you're pointing to this server with your requests. Don't use ngrok cos you'll hit their rate limit.
-
npm install
-
source .env
-
bash populateFiles.sh
: This runs a series ofcurl
statements to put files in./files
that will allow this api to attempt to simulate ddhq's responses. Won't run without thesource
command from above. -
npm run start
These are all GET routes.
-
/api/simulator/start
-
accepts two query parameters: "speed" and "vote_rate". these are just integers that scale up the frequency with which vote counts are updated and the amount by which they're updated. they both default to 1 if omitted.
-
e.g.
GET localhost:5000/api/simulator/start?speed=100&vote_rate=100
for turbo mode.
-
-
/api/simulator/pause
-
/api/simulator/stop
- same as
pause
, but clears all changes to base data made by the simulator.
- same as
-
/api/simulator/reset
- same as
stop
, but subsequently restarts the simulator.
- same as