Skip to content

Commit

Permalink
Merge pull request #152 from AthennaIO/develop
Browse files Browse the repository at this point in the history
feat(swagger): set athenna logo
  • Loading branch information
jlenon7 authored Oct 22, 2023
2 parents 0c4a640 + 476c0e9 commit d2844ac
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/http",
"version": "4.11.0",
"version": "4.12.0",
"description": "The Athenna Http server. Built on top of fastify.",
"license": "MIT",
"author": "João Lenon <[email protected]>",
Expand Down Expand Up @@ -39,7 +39,8 @@
"src/**/*.js",
"src/**/*.d.ts",
"templates",
"configurer"
"configurer",
"resources"
],
"type": "module",
"main": "./src/index.js",
Expand Down
Binary file added resources/images/athenna-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 12 additions & 1 deletion src/kernels/HttpKernel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,18 @@ export class HttpKernel {
'Not able to register swagger-ui plugin. Install @fastify/swagger-ui package.'
)

await Server.plugin(swaggerUiPlugin, Config.get('http.swagger.ui'))
const swaggerUiConfig = Config.get('http.swagger.ui', {})

if (!swaggerUiConfig.logo) {
const image = new File(Path.resources('images/athenna-logo.png'))

swaggerUiConfig.logo = {
type: 'image/png',
content: image.getContentSync()
}
}

await Server.plugin(swaggerUiPlugin, swaggerUiConfig)
}
}

Expand Down

0 comments on commit d2844ac

Please sign in to comment.