Endpoint
Un endpoint de una API sobre una placa: método, ruta, qué hace y cómo autenticarse.
import Endpoint from '@sypnia/ui/astro/Endpoint.astro'
En esta página
Leer, escribir, borrar
El método tiene su color; el slot badges lleva una versión o dónde existe.
GET
/v1/tables/{table}/rows The rows of a table, 20 at a time, newest first.
POST
/v1/tables/{table}/rows v1.4 Adds rows; up to 500 in one call.
DELETE
/v1/tables/{table} Deletes the table and its rows.
Código
---
import Endpoint from '@sypnia/ui/astro/Endpoint.astro';
import VersionBadge from '@sypnia/ui/astro/VersionBadge.astro';
---
<div class="sy-docs sy-stack" style="min-height:0;background:none;--gap:var(--s-4)">
<Endpoint method="GET" path="/v1/tables/{table}/rows" auth="API token (read)">The rows of a table, 20 at a time, newest first.</Endpoint>
<Endpoint method="POST" path="/v1/tables/{table}/rows" auth="API token (write)"><VersionBadge slot="badges" version="1.4" status="new" />Adds rows; up to 500 in one call.</Endpoint>
<Endpoint method="DELETE" path="/v1/tables/{table}" auth="API token (admin)">Deletes the table and its rows.</Endpoint>
</div> Cuándo usarlo
Úsalo cuando
- Páginas de referencia de la API, seguidas de Params, RequestExample, ResponseExample y ErrorList.
No lo uses cuando
- Nombrar un endpoint dentro de una frase: escríbelo como
code.
Para todos
- El método está escrito, no solo coloreado.
- Con
titletiene título, así aparece en «En esta página».