Skip to content

Commit

Permalink
Merge pull request #3 from maximmai/maximmai-fixed-typo-and-improved-…
Browse files Browse the repository at this point in the history
…constants

Fixed a typo and moved the hardcoded url to constants file
  • Loading branch information
PoProstuWitold authored Dec 20, 2023
2 parents dc8ffb0 + b3cf768 commit c5277b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion server/src/common/swagger/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const SWAGGER_API_ROOT = 'api/docs';
export const SWAGGER_API_NAME = 'Nest Next Boilerplate v1 API';
export const SWAGGER_API_DESCRIPTION = 'Basic docs for API in version 1';
export const SWAGGER_API_CURRENT_VERSION = '1.0';
export const SWAGGER_API_CURRENT_VERSION = '1.0';
export const SERVER_URL = 'http://localhost:4000';
9 changes: 5 additions & 4 deletions server/src/common/swagger/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import {
SWAGGER_API_NAME,
SWAGGER_API_DESCRIPTION,
SWAGGER_API_CURRENT_VERSION,
SERVER_URL
} from './constants'

export const setupSwagger = (app: INestApplication) => {
const server = 'http://localhost:4000/api'
const docs = 'http://localhost:4000/api/docs'
const server = `${SERVER_URL}/api`
const docs = `${SERVER_URL}/api/docs`

const options = new DocumentBuilder()
.setTitle(SWAGGER_API_NAME)
Expand All @@ -23,5 +24,5 @@ export const setupSwagger = (app: INestApplication) => {
SwaggerModule.setup(SWAGGER_API_ROOT, app, document)

const logger = new Logger('Documentation')
logger.log(`API Documentation for "${server}" is avaible at "${docs}"`)
}
logger.log(`API Documentation for "${server}" is available at "${docs}"`)
}

0 comments on commit c5277b1

Please sign in to comment.