feat: 新增搜素 API
This commit is contained in:
12
app/api/resources/route.ts
Normal file
12
app/api/resources/route.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { resourceSearch } from "../../../lib/mcp-operations";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const searchParams = new URL(request.url).searchParams;
|
||||
return Response.json(
|
||||
await resourceSearch({
|
||||
query: searchParams.get("q") ?? "",
|
||||
limit: Number(searchParams.get("limit")) || 50,
|
||||
offset: Number(searchParams.get("offset")) || 0,
|
||||
}),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user