Creating a simple application to show how to use background jobs.
Warning
Make it sure you have
docker
anddocker-compose
installed on your device
Note
Hover the items of the list below to get more detailed description
- Clone this repository
- Go to the
tiny-background-job-redis-ts
folder - Execute the command
cp .env.example .env
- Execute the command
docker-compose up --build -d
- Execute the command
yarn prisma migrate dev
- Execute the command
yarn dev
This is the main attraction of this repo, we're basically verifying if the user is passing a token through the authorization
query parameter, and then running a job to fake generate a report.
If the user don't give a token, a 401 status will be returning telling him is unauthorized.
You can check on the PR#1 how i changed from a sync route to a async background job.