Jobs are created by Firebase functions.
I created this project base on this tutorial.
You need to create Firebase CLI in the first, then install npm
$ cd functions
$ npm install
Or you can start a new firebase function
$ firebase init functions
The CLI gives you two options for language support:
- JavaScript
- TypeScript See Write Functions with TypeScript for more information.
The local Firebase emulators don't currently support pubsub. You need to uses Cloud Scheduler to trigger events on that topic, ensuring that your function runs on the desired schedule. So for the moment, you can test your function by:
# Go to shell
$ npm run shell
# then start function name
$ scheduledFunction();
# firebase > scheduledFunction();
# 'Successfully invoked function.'
# firebase > > {
# > eventId: '7612e344-4188-4473-a12e-d51ae7779b61',
# > timestamp: '2023-03-27T07:08:40.033Z',
# > eventType: 'pubsub',
# > params: {}
# > } context
# > This will be run every 10 seconds!
# coding convention
$ npm run lint
# fix eslint
$ npm run lint:fix
https://firebase.google.com/pricing#blaze-calculator
- Author - Richard Do
Nest is MIT licensed.