Endpoint
When documenting REST or RPC APIs, you need to clearly display the HTTP method (GET, POST, PUT, DELETE) and the route. The <Endpoint> component automatically color-codes the badge based on the method.
import Endpoint from '@/components/docs/Endpoint.astro';
<Endpoint method="GET" path="/v1/users/:id" /><Endpoint method="POST" path="/v1/users" /><Endpoint method="DELETE" path="/v1/users/:id" />Preview
Section titled “Preview” GET /v1/users/:id
POST /v1/users
DELETE /v1/users/:id
Properties
Section titled “Properties”| Prop | Type | Required | Description |
|---|---|---|---|
method | "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | Yes | The HTTP method, used to color-code the badge. |
path | string | Yes | The URI route or endpoint path. |