Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/NicolasLopes7/tiny-background-job-redis-ts
creating a simple application to show how to use background jobs
https://github.com/NicolasLopes7/tiny-background-job-redis-ts
Last synced: 3 months ago
JSON representation
creating a simple application to show how to use background jobs
- Host: GitHub
- URL: https://github.com/NicolasLopes7/tiny-background-job-redis-ts
- Owner: NicolasLopes7
- Created: 2022-07-17T14:55:20.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-07-17T18:24:33.000Z (over 2 years ago)
- Last Synced: 2024-06-12T14:19:08.812Z (5 months ago)
- Language: TypeScript
- Homepage:
- Size: 70.3 KB
- Stars: 14
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ⚡ Tiny Background Jobs App
Creating a simple application to show how to use background jobs.## 🚀 How to run
### First steps
> **Warning**
>
> Make it sure you have `docker` and `docker-compose` installed on your device> **Note**
>
> Hover the items of the list below to get more detailed description- [Clone this repository](# "You can use an external tool or clone directly using the command line with the command \"git clone\"")
- [Go to the `tiny-background-job-redis-ts` folder](# "This can be usually achieved by the command \"cd [path]\" but you can also use your preferred IDE")
- [Execute the command `cp .env.example .env`](# "This will copy the example environment variables to be used in your project")
- [Execute the command `docker-compose up --build -d`](# "Setup the docker-compose environment to create the containers")
- [Execute the command `yarn prisma migrate dev`](# "Execute the development migrations using prisma")
- [Execute the command `yarn dev`](# "Run the project in development mode")## 🧱 /report
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](https://github.com/NicolasLopes7/tiny-background-job-redis-ts/pull/1) how i changed from a sync route to a async background job.