Firebase - Handle cloud events within NestJS Framework
Turns out I was very close to the solution. instead of getService
, I had to use get
, like so:
const bootstrap = async (expressInstance: Express) => {
const app = await NestFactory.create(AppModule, expressInstance);
await app.init();
return app;
};
const main = bootstrap(server);
export const subscriptions = functions
.pubsub
.topic('cron-topic')
.onPublish((context, message) => main.then(app => {
return app.get(SubscribeService).initDailyCharges(context, message));
});