Skip to main content

add-admin-api-endpoint

Add a new endpoint or endpoints to Ghost's Admin API at `ghost/api/admin/**`.

Informações da origem

Repositório
TryGhost/Ghost
Última atividade na origem
9 de outubro de 2026 às 14:25
Idioma detectado do SKILL.md
inglês
Estrelas
55.544
Forks
11.995

Opções de instalação

Por padrão, está selecionado o prompt que primeiro revisa a origem. Você pode mudar para um comando direto ou baixar uma cópia local.

Revise os arquivos de origem

Leia o SKILL.md e os arquivos complementares exibidos pelo SkillsMP antes de decidir se vai instalar.

Explorador de arquivos
4 arquivos

Exibindo SKILL.md

SKILL.md
Instruções da origem · Visualização somente leitura
name
Add Admin API Endpoint
description
Add a new endpoint or endpoints to Ghost's Admin API at `ghost/api/admin/**`.
# Create Admin API Endpoint ## Instructions 1. If creating an endpoint for an entirely new resource, create a new endpoint file in `ghost/core/server/api/endpoints/`. Otherwise, locate the existing endpoint file in the same directory. 2. The endpoint file should create a controller object using the JSDoc type from (@tryghost/api-framework).Controller, including at minimum a `docName` and a single endpoint definition, i.e. `browse`. 3. Add routes for each endpoint to `ghost/core/server/web/api/endpoints/admin/routes.js`. 4. Add basic `e2e-api` tests for the endpoint in `ghost/test/e2e-api/admin` to ensure the new endpoints function as expected. 5. Run the tests and iterate until they pass: `cd ghost && pnpm test:single test/e2e-api/admin/{test-file-name}`. ## Reference For a detailed reference on Ghost's API framework and how to create API controllers, see [reference.md](reference.md).
Ver no GitHub