- PNPM
- NVM
$ nvm use
$ pnpm i
Local & test db:
$ pnpm db:migrate
This will produce two database files in the data
folder: one for the local development and another one for testing
$ pnpm db:seed
$ pnpm generate-tokens
Inside the artillery/api-load.yml
file, replace REPLACE_ME_WITH_A_REAL_TOKEN
with one of the generated tokens.
$ cp .env.sample .env
Then replace JWT_SECRET
with a real one.
$ pnpm test
Test the API via artillery
:
$ pnpm start # first run the server
$ pnpm test:api:load # second run the load-test
The config file is: artillery/api-load.yml
The API are limited using express-rate-limit
The API are time-limited using express-slow-down