Skip to content

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" />
GET /v1/users/:id
POST /v1/users
DELETE /v1/users/:id
PropTypeRequiredDescription
method"GET" | "POST" | "PUT" | "PATCH" | "DELETE"YesThe HTTP method, used to color-code the badge.
pathstringYesThe URI route or endpoint path.