feat: integrate Cloudinary image upload, Instagram Feed, and fix Next.js warnings
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { v2 as cloudinary } from "cloudinary";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
cloudinary.config({
|
||||
cloud_name: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME,
|
||||
api_key: process.env.CLOUDINARY_API_KEY,
|
||||
api_secret: process.env.CLOUDINARY_API_SECRET,
|
||||
});
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const body = await request.json();
|
||||
const { paramsToSign } = body;
|
||||
|
||||
const signature = cloudinary.utils.api_sign_request(
|
||||
paramsToSign,
|
||||
process.env.CLOUDINARY_API_SECRET as string
|
||||
);
|
||||
|
||||
return NextResponse.json({ signature });
|
||||
}
|
||||
Reference in New Issue
Block a user