端点未返回响应。
EndpointDidNotReturnAResponse:端点必须返回
Response或使用Response解析的Promise。¥EndpointDidNotReturnAResponse: An endpoint must return either a
Response, or aPromisethat resolves with aResponse.
什么地方出了错?
Section titled “什么地方出了错?”¥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!' })}