product-sync.ts
unknown
typescript
a year ago
680 B
14
Indexable
import { AppModule } from '@/app.module';
import constants from '@/constants';
import { SentryFilter } from '@/shared/sentry.filter';
import { SheetsService } from '@/sheets/sheets.service';
import { HttpAdapterHost, NestFactory } from '@nestjs/core';
import { Context } from 'aws-lambda';
export const handler = async (event: any, context: Context) => {
const nestApp = await NestFactory.create(AppModule);
const { httpAdapter } = nestApp.get(HttpAdapterHost);
nestApp.useGlobalFilters(new SentryFilter(httpAdapter));
const sheetsService = nestApp.get<SheetsService>(SheetsService);
await sheetsService.readSpreadsheet(constants.productsSheetId);
};
Editor is loading...
Leave a Comment