在标准核心结构中创建或扩展 Ghost Admin API 端点代码,使用此技能可在 `ghost/core/core/s...` 路径下添加新的端点文件。
This guide provides a comprehensive approach for developers to test newly created endpoints in Ghost's Admin API. Follow the steps below to ensure your endpoints are functioning correctly.
ghost/core/core/server/api/endpoints/. If the endpoint already exists, locate the corresponding file in the same directory.@tryghost/api-framework.Controller. Ensure it includes at least a docName and a single endpoint definition, such as browse.ghost/core/core/server/web/api/endpoints/admin/routes.js to make them accessible through the API.ghost/core/test/e2e-api/admin. This will help verify that the endpoint functions as expected.cd ghost/core && yarn test:single test/e2e-api/admin/{test-file-name} to run your specific test file.For further details on Ghost's API framework and how to create API controllers, refer to the official documentation.