[MVPTN-80] deploy(Docker): Ajuste de API de requisição

This commit is contained in:
Keven Willian Pereira de Souza 2025-09-29 14:49:07 -03:00
parent f7f3225c88
commit f3f1329c3e
2 changed files with 7 additions and 9 deletions

View file

@ -5,11 +5,12 @@ const nextConfig: NextConfig = {
async rewrites() {
return [
{
source: '/api/v1/:path*', // somente rotas API
source: '/api/v1/:path*',
destination: 'http://api_saas_api_homologacao:8000/api/v1/:path*',
},
];
},
};
export default nextConfig;

View file

@ -37,18 +37,15 @@ export default class API {
// Verifica se existe body para envio
const filteredBody = _data.body
? Object.fromEntries(
Object.entries(_data.body).filter(
([_, v]) => v != null && v !== "",
),
)
Object.entries(_data.body).filter(
([_, v]) => v != null && v !== "",
),
)
: null;
console.log(`/${this.ApiSchema.prefix}${this.ApiSchema.endpoint}`);
// Realiza a requisição
const response = await fetch(
`/${this.ApiSchema.prefix}${this.ApiSchema.endpoint}`,
`${this.ApiSchema.url}${this.ApiSchema.prefix}${this.ApiSchema.endpoint}`,
{
method: _data.method,
headers: {