- Create a
.env
file at the root of this repo. - Add the following env variables:
DATABASE_URL="file:./dev.db"
JWTSECRET="{JWT encyption string here}"
REFRESHTOKENSECRET="{refresh encryption string here}"
PORT=3001
- Follow steps 2 to 5 below.
- delete ./prisma/dev.db to delete the DB instance.
- run
npx prisma migrate dev
to migrate the DB changes. - run
npm run build
to busild distribution folder. - run
node ./dist/mockData/generateTestData.js
to seed the DB with test data. - restart server with
node ./dist/index.js
.
Pagination settings are set in the settings.ts
file. A piece of middleware is used to protect every endpoint where pagination is an option to ensure that maximum page sizes are observed.