diff --git a/dev/next-env.d.ts b/dev/next-env.d.ts index 830fb59..1b3be08 100644 --- a/dev/next-env.d.ts +++ b/dev/next-env.d.ts @@ -1,6 +1,5 @@ /// /// -/// // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/src/rapidocPlugin.ts b/src/rapidocPlugin.ts index 81d6314..2970720 100644 --- a/src/rapidocPlugin.ts +++ b/src/rapidocPlugin.ts @@ -2,7 +2,7 @@ import type { Plugin } from 'payload' const rapidoc = ({ - specEndpoint = '/openapi.json', + specEndpoint = '/api/openapi.json', docsUrl = '/docs', enabled = true, }: { @@ -38,7 +38,7 @@ const rapidoc = - + `, { headers: { 'content-type': 'text/html' } }, diff --git a/src/redocPlugin.ts b/src/redocPlugin.ts index 2d975ae..1dbabf4 100644 --- a/src/redocPlugin.ts +++ b/src/redocPlugin.ts @@ -2,7 +2,7 @@ import type { Plugin } from 'payload' const redoc = ({ - specEndpoint = '/openapi.json', + specEndpoint = '/api/openapi.json', docsUrl = '/docs', enabled = true, }: { @@ -43,7 +43,7 @@ const redoc = - + `, diff --git a/src/scalarPlugin.ts b/src/scalarPlugin.ts index c17c2a4..12c0f47 100644 --- a/src/scalarPlugin.ts +++ b/src/scalarPlugin.ts @@ -2,7 +2,7 @@ import type { Plugin } from 'payload' const scalar = ({ - specEndpoint = '/openapi.json', + specEndpoint = '/api/openapi.json', docsUrl = '/docs', enabled = true, }: { @@ -23,7 +23,7 @@ const scalar = method: 'get', path: docsUrl, handler: async req => { - const fullSpecUrl = `${req.protocol}//${req.headers.get('host')}/api${specEndpoint}` + const fullSpecUrl = `${req.protocol}//${req.headers.get('host')}${specEndpoint}` const html = ` diff --git a/src/swaggerUIPlugin.ts b/src/swaggerUIPlugin.ts index c43a79a..ea56df3 100644 --- a/src/swaggerUIPlugin.ts +++ b/src/swaggerUIPlugin.ts @@ -2,7 +2,7 @@ import type { Config, Plugin } from 'payload' const swaggerUI = ({ - specEndpoint = '/openapi.json', + specEndpoint = '/api/openapi.json', docsUrl = '/docs', enabled = true, }: { @@ -42,7 +42,7 @@ const swaggerUI =