diff --git a/src/index.ts b/src/index.ts index eefbfbd..cfe7f8e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -17,12 +17,14 @@ export const swagger = version = '4.18.2', excludeStaticFile = true, path = '/swagger' as Path, + specPathname = 'json', exclude = [] }: ElysiaSwaggerConfig = { documentation: {}, version: '4.18.2', excludeStaticFile: true, path: '/swagger' as Path, + specPathname: 'json', exclude: [] } ) => @@ -33,6 +35,10 @@ export const swagger = version: '0.0.0', ...documentation.info } + + if (specPathname.startsWith('/')) { + specPathname = specPathname.slice(1) + } app.get(path, (context) => { return new Response( @@ -58,7 +64,7 @@ export const swagger =