From 5b564e509e50681fccfcd06882b56572f7b85ad5 Mon Sep 17 00:00:00 2001 From: erik1110 Date: Wed, 17 Jan 2024 09:47:59 +0800 Subject: [PATCH 1/2] [docs] add description --- src/main.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index a288c67..9302a50 100644 --- a/src/main.ts +++ b/src/main.ts @@ -11,8 +11,17 @@ async function bootstrap() { app.useGlobalFilters(new ErrorHandlerFilter()); const config = new DocumentBuilder() .setTitle('Hotel Reservation Backend') - .setDescription('This is my swagger document.') + .setDescription(`Building a Hotel Reservation API on the Backend with TypeScript.\n\nNote: After successful login, please click on "Authorize" and enter your access token.\n\nExample Code : + + fetch('/api/v1/home/news', { method: 'GET' }) + .then(response => response.json()) + .then(res => { + // { status: 'true', result: [{...}] } + console.log(res); + }); + `) .setVersion('1.0') + .addServer(`http://localhost:${process.env.PORT}`, 'Local Environment') .addServer(process.env.PRODUCTION_URL, 'Production') // HTTPS scheme .addBearerAuth() From 02b19176f5cc2a6ba8b4c7466a9df493326bc878 Mon Sep 17 00:00:00 2001 From: erik1110 Date: Wed, 17 Jan 2024 09:48:22 +0800 Subject: [PATCH 2/2] [style] remove space --- src/main.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 9302a50..61ef8e4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -21,7 +21,6 @@ async function bootstrap() { }); `) .setVersion('1.0') - .addServer(`http://localhost:${process.env.PORT}`, 'Local Environment') .addServer(process.env.PRODUCTION_URL, 'Production') // HTTPS scheme .addBearerAuth()