Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion dev/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference path="./.next/types/routes.d.ts" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
4 changes: 2 additions & 2 deletions src/rapidocPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Plugin } from 'payload'

const rapidoc =
({
specEndpoint = '/openapi.json',
specEndpoint = '/api/openapi.json',
docsUrl = '/docs',
enabled = true,
}: {
Expand Down Expand Up @@ -38,7 +38,7 @@ const rapidoc =
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/rapidoc@9.3.8/dist/rapidoc-min.js" type="module"></script>
<rapi-doc spec-url="${req.protocol}//${req.headers.get('host')}/api${specEndpoint}"></rapi-doc>
<rapi-doc spec-url="${req.protocol}//${req.headers.get('host')}${specEndpoint}"></rapi-doc>
</body>
</html>`,
{ headers: { 'content-type': 'text/html' } },
Expand Down
4 changes: 2 additions & 2 deletions src/redocPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Plugin } from 'payload'

const redoc =
({
specEndpoint = '/openapi.json',
specEndpoint = '/api/openapi.json',
docsUrl = '/docs',
enabled = true,
}: {
Expand Down Expand Up @@ -43,7 +43,7 @@ const redoc =
</style>
</head>
<body>
<redoc spec-url="${req.protocol}//${req.headers.get('host')}/api${specEndpoint}"></redoc>
<redoc spec-url="${req.protocol}//${req.headers.get('host')}${specEndpoint}"></redoc>
<script src="https://cdn.jsdelivr.net/npm/redoc@2.4.0/bundles/redoc.standalone.js"></script>
</body>
</html>`,
Expand Down
4 changes: 2 additions & 2 deletions src/scalarPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Plugin } from 'payload'

const scalar =
({
specEndpoint = '/openapi.json',
specEndpoint = '/api/openapi.json',
docsUrl = '/docs',
enabled = true,
}: {
Expand All @@ -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 = `
<!DOCTYPE html>
Expand Down
4 changes: 2 additions & 2 deletions src/swaggerUIPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Config, Plugin } from 'payload'

const swaggerUI =
({
specEndpoint = '/openapi.json',
specEndpoint = '/api/openapi.json',
docsUrl = '/docs',
enabled = true,
}: {
Expand Down Expand Up @@ -42,7 +42,7 @@ const swaggerUI =
<script>
window.onload = () => {
window.ui = SwaggerUIBundle({
url: '${req.protocol}//${req.headers.get('host')}/api${specEndpoint}',
url: '${req.protocol}//${req.headers.get('host')}${specEndpoint}',
dom_id: '#swagger-ui',
});
};
Expand Down