Skip to content

Commit

Permalink
fix: api calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Joabesv committed Aug 12, 2024
1 parent ce8ca82 commit b6f67b2
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/services/NextAPI.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
import Axios from "axios";
import Axios from 'axios';

function resolveEndpoint(env) {
return (

{
development: "http://localhost:5000/v2",
staging: "https://ufabc-matricula-test.cdd.naoseiprogramar.com.br/v1",
production: "https://api.ufabcnext.com/v1",
}[env] || "http://localhost:8011/v1"

development: 'http://localhost:5000/v2',
staging: 'https://ufabc-matricula-test.cdd.naoseiprogramar.com.br/v1',
production: 'https://api.ufabcnext.com/v1',
}[env] || 'http://localhost:8011/v1'
);
}

function NextAPI() {
const baseURL = resolveEndpoint("development");
const baseURL = resolveEndpoint(process.env.NODE_ENV);
const REQUEST_TIMEOUT = 5000;
const nextAPI = Axios.create({
baseURL,
timeout: REQUEST_TIMEOUT,
headers: {
Accept: "application/json",
"Content-Type": "application/json",
Accept: 'application/json',
'Content-Type': 'application/json',
},
});

Expand Down

0 comments on commit b6f67b2

Please sign in to comment.