Skip to content

Commit

Permalink
Remove comment
Browse files Browse the repository at this point in the history
  • Loading branch information
DatHoang102003 committed Oct 18, 2024
1 parent becbb37 commit a19501f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion backend/src/app.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ describe('AppController', () => {
});
});

// Test case for the dummy API
describe('dummy', () => {
it('should return "This is dummy data"', () => {
expect(appController.getDummy()).toBe('This is dummy data');
Expand Down
6 changes: 3 additions & 3 deletions backend/src/app.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { Controller, Get } from '@nestjs/common';
import { AppService } from './app.service';
import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger';

@ApiTags('App') // Group your controller's routes under 'App' tag in Swagger UI
@ApiTags('App')
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}

@Get()
@ApiOperation({ summary: 'Get a welcome message' }) // Document the operation
@ApiResponse({ status: 200, description: 'Return Hello World message' }) // Define a response
@ApiOperation({ summary: 'Get a welcome message' })
@ApiResponse({ status: 200, description: 'Return Hello World message' })
getHello(): string {
return this.appService.getHello();
}
Expand Down
3 changes: 1 addition & 2 deletions backend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
async function bootstrap() {
const app = await NestFactory.create(AppModule);

// Swagger setup
const config = new DocumentBuilder()
.setTitle('NestJS API')
.setDescription('NestJS API documentation')
.setVersion('1.0')
.build();
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup('api', app, document); // Swagger will be available at /api
SwaggerModule.setup('api', app, document);

await app.listen(3000);
}
Expand Down

0 comments on commit a19501f

Please sign in to comment.