22 lines
579 B
TypeScript
22 lines
579 B
TypeScript
import { Controller, Get, Param, ParseIntPipe } from '@nestjs/common';
|
|
import { AppService } from './app.service';
|
|
import { ScraperService } from './scraper/scraper.service';
|
|
|
|
@Controller()
|
|
export class AppController {
|
|
constructor(
|
|
private readonly appService: AppService,
|
|
private readonly scraperService: ScraperService,
|
|
) {}
|
|
|
|
@Get()
|
|
getHello(): string {
|
|
return this.appService.getHello();
|
|
}
|
|
|
|
@Get('scrape/:sourceId')
|
|
async triggerScrape(@Param('sourceId', ParseIntPipe) sourceId: number) {
|
|
return this.scraperService.manualScrape(sourceId);
|
|
}
|
|
}
|