Skip to content

Instantly share code, notes, and snippets.

@onwuvic
Created May 11, 2020 07:17
Show Gist options
  • Save onwuvic/9ddc7442399e913788a66640646b960b to your computer and use it in GitHub Desktop.
Save onwuvic/9ddc7442399e913788a66640646b960b to your computer and use it in GitHub Desktop.
Post example controller
import { Controller, Get } from '@nestjs/common';
@Controller('posts')
export class PostsController {
@Get()
findAll(): string {
return 'This action returns all posts';
}
@Get(:id)
findOne(@Param('id') id: number): string {
return 'This action returns one post';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment