From 9ed5bd02915c1a276319cfade4b9c40117666e4d Mon Sep 17 00:00:00 2001 From: Hazmi Alfarizqi Date: Sat, 19 Oct 2024 20:14:06 +0700 Subject: [PATCH] fix: should be appPrefix --- src/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 5b41b05..ce35d27 100644 --- a/src/index.ts +++ b/src/index.ts @@ -62,7 +62,8 @@ export const swagger = async ( } const app = new Elysia({ name: '@elysiajs/swagger' }) - const prefixedPath = join(app.config.prefix ?? "/", path) + const appPrefix = app.config.prefix ?? "/" + const prefixedPath = join(appPrefix, path) app.get(path, function documentation(request) { // External Prefix, if the app is behind a reverse proxy @@ -137,7 +138,7 @@ export const swagger = async ( schema, hook: route.hooks, method, - path: join(extPrefix, prefixedPath, route.path), + path: join(extPrefix, appPrefix, route.path), // @ts-ignore models: app.definitions?.type, contentType: route.hooks.type @@ -150,7 +151,7 @@ export const swagger = async ( schema, hook: route.hooks, method: route.method, - path: join(extPrefix, prefixedPath, route.path), + path: join(extPrefix, appPrefix, route.path), // @ts-ignore models: app.definitions?.type, contentType: route.hooks.type