-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroute.ts
More file actions
22 lines (17 loc) · 774 Bytes
/
route.ts
File metadata and controls
22 lines (17 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { VectorizeAPIConfig } from "@vectorize-io/vectorize-connect";
import { NextRequest, NextResponse } from "next/server";
/**
* Retrieves Vectorize API configuration from environment variables
* @param request - The incoming Next.js request
* @returns JSON response with Vectorize API configuration
*/
export async function GET(request: NextRequest) {
const config: VectorizeAPIConfig = {
organizationId: process.env.VECTORIZE_ORGANIZATION_ID ?? "",
authorization: process.env.VECTORIZE_API_KEY ?? "",
};
if (!config.organizationId || !config.authorization) {
return NextResponse.json({ error: "Vectorize API configuration is missing." }, { status: 500 });
}
return NextResponse.json(config, { status: 200 });
}