Skip to content

Commit

Permalink
feat: 🎸 add main api doc
Browse files Browse the repository at this point in the history
  • Loading branch information
yeukfei02 committed Apr 20, 2022
1 parent fa43eec commit e03f4d2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/app.controller.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import { Controller, Get } from '@nestjs/common';
import { AppService } from './app.service';

import { ApiResponse } from '@nestjs/swagger';
import { GetMainResponse } from './response/getMain.response';

@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}

@Get()
@ApiResponse({
status: 200,
description: 'Successful response',
type: GetMainResponse,
})
getMain(): any {
const response = this.appService.getMain();
return response;
Expand Down
6 changes: 6 additions & 0 deletions src/response/getMain.response.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { ApiProperty } from '@nestjs/swagger';

export class GetMainResponse {
@ApiProperty()
message: string;
}

0 comments on commit e03f4d2

Please sign in to comment.