42 lines
975 B
TypeScript
42 lines
975 B
TypeScript
import type { NextConfig } from 'next';
|
|
|
|
const nextConfig: NextConfig = {
|
|
/* config options here */
|
|
images: {
|
|
remotePatterns: [
|
|
{
|
|
protocol: 'https',
|
|
hostname: 'avatars.githubusercontent.com',
|
|
},
|
|
{
|
|
protocol: 'https',
|
|
hostname: 'lh3.googleusercontent.com',
|
|
},
|
|
],
|
|
},
|
|
|
|
// Configurações de CORS para APIs
|
|
async headers() {
|
|
return [
|
|
{
|
|
// Aplicar a todas as rotas da API
|
|
source: '/api/:path*',
|
|
headers: [
|
|
{ key: 'Access-Control-Allow-Credentials', value: 'true' },
|
|
{ key: 'Access-Control-Allow-Origin', value: '*' },
|
|
{
|
|
key: 'Access-Control-Allow-Methods',
|
|
value: 'GET,POST,PUT,DELETE,OPTIONS,PATCH',
|
|
},
|
|
{
|
|
key: 'Access-Control-Allow-Headers',
|
|
value: 'Content-Type, Authorization, X-Requested-With',
|
|
},
|
|
],
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|