The endpoint did not return a Response.
EndpointDidNotReturnAResponse: 一个端点必须返回一个
Response,或者一个解析为Response的Promise。
哪里出了问题?
段落标题 哪里出了问题?当一个端点没有返回任何内容,或者返回的不是 Response 对象时会抛出此错误。
一个端点必须返回一个 Response,或者一个解析为 Response 的 Promise。例如:
import type { APIContext } from 'astro';
export async function GET({ request, url, cookies }: APIContext): Promise<Response> { return Response.json({ success: true, result: '来自 Astro 端点的数据!' })}