Files
the-biergarten-app/archive/next-js-web-app/src/config/cloudinary/index.ts
2026-04-20 02:30:25 -04:00

24 lines
560 B
TypeScript

import { v2 as cloudinary } from 'cloudinary';
import {
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME,
CLOUDINARY_KEY,
CLOUDINARY_SECRET,
NODE_ENV,
} from '../env';
import CloudinaryStorage from './CloudinaryStorage';
cloudinary.config({
cloud_name: NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME,
api_key: CLOUDINARY_KEY,
api_secret: CLOUDINARY_SECRET,
});
/** Cloudinary storage instance. */
const storage = new CloudinaryStorage({
cloudinary,
params: { folder: NODE_ENV === 'production' ? 'biergarten' : 'biergarten-dev' },
});
export { cloudinary, storage };