From b0b704a802f15e48399dc70b93eaba18c1cd9dbf Mon Sep 17 00:00:00 2001 From: jlenon7 Date: Sun, 22 Oct 2023 13:01:39 +0100 Subject: [PATCH] fix(path): use dirname to resolve path --- package-lock.json | 4 ++-- package.json | 2 +- src/kernels/HttpKernel.ts | 12 +++++++++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index ac3706c..f1b41bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@athenna/http", - "version": "4.12.1", + "version": "4.12.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@athenna/http", - "version": "4.12.1", + "version": "4.12.2", "license": "MIT", "devDependencies": { "@athenna/artisan": "^4.14.0", diff --git a/package.json b/package.json index c410f50..aef6a9f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@athenna/http", - "version": "4.12.1", + "version": "4.12.2", "description": "The Athenna Http server. Built on top of fastify.", "license": "MIT", "author": "João Lenon ", diff --git a/src/kernels/HttpKernel.ts b/src/kernels/HttpKernel.ts index 76f201b..9ad0557 100644 --- a/src/kernels/HttpKernel.ts +++ b/src/kernels/HttpKernel.ts @@ -101,7 +101,17 @@ export class HttpKernel { const swaggerUiConfig = Config.get('http.swagger.ui', {}) if (!swaggerUiConfig.logo) { - const image = new File(Path.resources('images/athenna-logo.png')) + const __dirname = Module.createDirname(import.meta.url) + const image = new File( + resolve( + __dirname, + '..', + '..', + 'resources', + 'images', + 'athenna-logo.png' + ) + ) swaggerUiConfig.logo = { type: 'image/png',