diff --git a/src/app/api/cosmos/route.ts b/src/app/api/cosmos/route.ts index 2946791..c8ab941 100644 --- a/src/app/api/cosmos/route.ts +++ b/src/app/api/cosmos/route.ts @@ -2,11 +2,11 @@ import { CosmosClient } from "@azure/cosmos"; import { NextResponse } from "next/server"; const COSMOS_CONNECTION_STRING = process.env.COSMOS_CONNECTION_STRING ?? ""; -const client = new CosmosClient(COSMOS_CONNECTION_STRING); -const DB_ID = "nhuttudb"; -const CONT_ID = "nhuttucont"; export async function GET(request: Request) { + const client = new CosmosClient(COSMOS_CONNECTION_STRING); + const DB_ID = "nhuttudb"; + const CONT_ID = "nhuttucont"; const db = await client.databases.createIfNotExists({ id: DB_ID }); const cont = await db.database.containers.createIfNotExists({ id: CONT_ID }); diff --git a/src/app/api/file/route.ts b/src/app/api/file/route.ts index d9e9c86..f5aa5a7 100644 --- a/src/app/api/file/route.ts +++ b/src/app/api/file/route.ts @@ -1,5 +1,3 @@ -// pages/api/upload.js - import { BlobServiceClient, BlockBlobUploadOptions } from "@azure/storage-blob"; import { NextRequest, NextResponse } from "next/server";