Skip to content

端点未返回响应。

EndpointDidNotReturnAResponse:端点必须返回 Response 或使用 Response 解析的 Promise

¥EndpointDidNotReturnAResponse: An endpoint must return either a Response, or a Promise that resolves with a Response.

¥What went wrong?

当端点不返回任何内容或返回不是 Response 对象的对象时抛出。

¥Thrown when an endpoint does not return anything or returns an object that is not a Response object.

端点必须返回 Response 或使用 Response 解析的 Promise。例如:

¥An endpoint must return either a Response, or a Promise that resolves with a Response. For example:

import type { APIContext } from 'astro';
export async function GET({ request, url, cookies }: APIContext): Promise<Response> {
return Response.json({
success: true,
result: 'Data from Astro Endpoint!'
})
}
Astro 中文网 - 粤ICP备13048890号