Skip to content

Commit

Permalink
OpenAPI: use Route Handler instead
Browse files Browse the repository at this point in the history
  • Loading branch information
fuma-nama committed Dec 17, 2024
1 parent 8aff7f4 commit 1201138
Show file tree
Hide file tree
Showing 12 changed files with 305 additions and 266 deletions.
2 changes: 1 addition & 1 deletion .changeset/angry-dingos-poke.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'fumadocs-openapi': minor
---

Support Server Action Proxy
Support Route Handler Proxy
3 changes: 3 additions & 0 deletions apps/docs/app/api/proxy/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { openapi } from '@/app/source';

export const { GET, HEAD, PUT, POST, PATCH, DELETE } = openapi.createProxy();
1 change: 1 addition & 0 deletions apps/docs/app/source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const blog = loader({
});

export const openapi = createOpenAPI({
proxyUrl: '/api/proxy',
shikiOptions: {
themes: {
dark: 'vesper',
Expand Down
Loading

0 comments on commit 1201138

Please sign in to comment.