diff --git a/cv/src/app.controller.spec.ts b/cv/src/app.controller.spec.ts
index d22f389..d7625e3 100644
--- a/cv/src/app.controller.spec.ts
+++ b/cv/src/app.controller.spec.ts
@@ -16,7 +16,7 @@ describe('AppController', () => {
describe('root', () => {
it('should return "Hello World!"', () => {
- expect(appController.getHello()).toBe('Hello World!');
+ expect(appController.sayHello()).toBe('Hello World!');
});
});
});
diff --git a/cv/src/app.controller.ts b/cv/src/app.controller.ts
index cce879e..ab4b447 100644
--- a/cv/src/app.controller.ts
+++ b/cv/src/app.controller.ts
@@ -5,8 +5,9 @@ import { AppService } from './app.service';
export class AppController {
constructor(private readonly appService: AppService) {}
- @Get()
- getHello(): string {
- return this.appService.getHello();
- }
+ @Get()
+ sayHello(): string {
+ return this.appService.getHello();
+ }
+
}
diff --git a/cv/src/main.ts b/cv/src/main.ts
index 13cad38..17a7126 100644
--- a/cv/src/main.ts
+++ b/cv/src/main.ts
@@ -1,8 +1,27 @@
-import { NestFactory } from '@nestjs/core';
-import { AppModule } from './app.module';
+import { NestFactory } from "@nestjs/core";
+import { AppModule } from "./app.module";
+import { SwaggerModule, DocumentBuilder } from "@nestjs/swagger";
async function bootstrap() {
- const app = await NestFactory.create(AppModule);
- await app.listen(3000);
+ const app = await NestFactory.create(AppModule);
+
+ const config = new DocumentBuilder()
+ .setTitle("Thom Werring - CV")
+ .setDescription("Westerstraat 83
1521ZB, Wormerveer
+31 6 37 65 08 49")
+ .addApiKey({
+ type: "apiKey",
+ name: "Authorization",
+ bearerFormat: "bearer",
+ }, "Credentials")
+ .setVersion("1.0.0a")
+ .build();
+ const document = SwaggerModule.createDocument(app, config, {
+ operationIdFactory: (controllerKey: string, methodKey: string) => (`${methodKey[0].toUpperCase()}${methodKey.substring(1)}`)
+ });
+
+ SwaggerModule.setup("/api", app, document);
+
+ await app.listen(3000);
}
+
bootstrap();