NestJS cron Module
NestJS cron package allows you easily setup cron for your controllers or services.
npm i nestjs-cron
Then register module in your root app.module
; @ {}
To use cron, decorate your class with @Scheduled()
and method with @Cron('* * * * * *')
To use ConfigService in any service or controller just inject it with @ConfigInjection
decorator in the constructor:
; {}
To get a value from .env file just call get()
method:
thisconfigService;
- JIRA_TOKEN - name of your key in
.env
file:
JIRA_TOKEN=0000000000000