fix(App.ts): Ajuste a url de homologação, retirada de entrada estatica para entrada dinamica

This commit is contained in:
Kenio 2025-09-12 18:04:27 -03:00
parent 7ec1259ba0
commit db359d12bc
3 changed files with 6 additions and 16 deletions

View file

@ -1,16 +1,6 @@
import appConfig from '../../config/app.json';
export default class Json {
static execute(path: string) {
return {
"state": "go",
"api": {
"url": "http://localhost:8000/",
"prefix": "api/v1",
"content_type": "application/json"
}
}
static execute() {
return appConfig;
}
}

View file

@ -1,7 +1,7 @@
{
"state": "go",
"api": {
"url": "http://localhost:3000/",
"url": "http://localhost:8000/",
"prefix": "api/v1/",
"content_type": "application/json"
}

View file

@ -17,7 +17,7 @@ export default class API {
this.ApiSchema = new ApiSchema();
// Obtem as configurações da aplicação
this.config = Json.execute('config/app.json');
this.config = Json.execute();
}
@ -46,7 +46,7 @@ export default class API {
const filteredBody = _data.body ? Object.fromEntries(Object.entries(_data.body).filter(([_, v]) => v != null && v !== "")) : null;
// Realiza a requisição
const response = await fetch(`${this.ApiSchema.url}${this.ApiSchema.prefix}/${this.ApiSchema.endpoint}`, {
const response = await fetch(`${this.ApiSchema.url}${this.ApiSchema.prefix}${this.ApiSchema.endpoint}`, {
method: _data.method,
headers: {
"Accept": `${this.ApiSchema.contentType}`,