33831/frontend/src/pages/api/pexels-image.ts
Flatlogic Bot aa77177631 v3.1
2025-09-03 20:53:55 +00:00

14 lines
471 B
TypeScript

import type { NextApiRequest, NextApiResponse } from 'next';
import axios from 'axios';
import { baseURLApi } from '../../../config';
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
try {
const { data } = await axios.get(`${baseURLApi}/pexels/image`);
res.status(200).json(data);
} catch (error) {
console.error('Error proxying pexels image:', error);
res.status(500).json({ error: 'Error fetching image' });
}
}