Skip to content

Instantly share code, notes, and snippets.

@kop7
Created August 12, 2020 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kop7/d088360fe8bf9ebf49a0e0fb091d818b to your computer and use it in GitHub Desktop.
Save kop7/d088360fe8bf9ebf49a0e0fb091d818b to your computer and use it in GitHub Desktop.
Movie Controller
import { Controller, Get, Query } from '@nestjs/common';
import { MovieService } from './movie.service';
@Controller()
export class MovieController {
constructor(public readonly movieService: MovieService) {}
@Get('movies')
async getMovies(@Query('search') search: string) {
if (search !== undefined && search.length > 1) {
return await this.movieService.findMovies(search);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment