homeweatherapi/src/app.controller.ts

16 lines
411 B
TypeScript

import { Controller, Get, UseInterceptors } from '@nestjs/common';
import { AppService } from './app.service';
import { CacheInterceptor, CacheTTL } from '@nestjs/cache-manager';
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
@Get()
@UseInterceptors(CacheInterceptor)
@CacheTTL(60000)
getWeather() {
return this.appService.getWeather();
}
}