mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-24 20:09:02 +00:00
docs: mention fumapress
This commit is contained in:
@@ -9,9 +9,7 @@ import { CpuIcon, PanelsTopLeftIcon, DatabaseIcon, TerminalIcon } from 'lucide-r
|
||||
## Introduction
|
||||
|
||||
Fumadocs <span className='text-fd-muted-foreground text-sm'>(Foo-ma docs)</span> is a **documentation framework**, designed to be fast, flexible,
|
||||
and composes seamlessly into your React framework.
|
||||
|
||||
Fumadocs has different parts:
|
||||
and composes seamlessly into your React framework. It consists of multiple layers:
|
||||
|
||||
<Cards>
|
||||
|
||||
@@ -53,6 +51,11 @@ A command line tool to install UI components and automate things, useful for cus
|
||||
|
||||
Some basic knowledge of React.js would be useful for further customizations.
|
||||
|
||||
<Callout title="Love Fumadocs but not familiar with React?">
|
||||
[Fumapress](https://press.fumadocs.dev) is a site generator that has lower barrier for beginners.
|
||||
It enforces a React framework of its own, and offers a better DX in return.
|
||||
</Callout>
|
||||
|
||||
## Automatic Installation
|
||||
|
||||
A minimum version of Node.js 22 required.
|
||||
|
||||
@@ -54,7 +54,7 @@ We can use it for executing HTTP requests on the OpenAPI playground, when the ta
|
||||
|
||||
Create a route handler for proxy server.
|
||||
|
||||
```ts title="/api/proxy/route.ts"
|
||||
```ts tab="Next.js" title="app/api/proxy/route.ts"
|
||||
import { openapi } from '@/lib/openapi';
|
||||
|
||||
export const { GET, HEAD, PUT, POST, PATCH, DELETE } = openapi.createProxy({
|
||||
@@ -63,7 +63,35 @@ export const { GET, HEAD, PUT, POST, PATCH, DELETE } = openapi.createProxy({
|
||||
});
|
||||
```
|
||||
|
||||
> Follow the [Getting Started](/docs/openapi) guide if `openapi` instance is not yet configured.
|
||||
```ts tab="Tanstack Start" title="app/routes/api/proxy.ts"
|
||||
import { openapi } from '@/lib/openapi';
|
||||
import { createFileRoute } from '@tanstack/react-router';
|
||||
|
||||
const proxy = openapi.createProxy({
|
||||
// optional, we recommend to set a list of allowed origins for proxied requests
|
||||
allowedOrigins: ['https://example.com'],
|
||||
});
|
||||
|
||||
export const Route = createFileRoute('/api/proxy')({
|
||||
server: {
|
||||
handlers: {
|
||||
// Handles all methods by default, or specify individual methods (GET, POST, etc.)
|
||||
'*': async ({ request }) => {
|
||||
return proxy.handle(request);
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
```ts tab="Waku" title="src/pages/_api/api/proxy.ts"
|
||||
import { openapi } from '@/lib/openapi';
|
||||
|
||||
export const { GET, HEAD, PUT, POST, PATCH, DELETE } = openapi.createProxy({
|
||||
// optional, we recommend to set a list of allowed origins for proxied requests
|
||||
allowedOrigins: ['https://example.com'],
|
||||
});
|
||||
```
|
||||
|
||||
And set the proxy URL in `createOpenAPI`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user