diff --git a/src/services/NextAPI.js b/src/services/NextAPI.js index 405b89a..2f1ac89 100644 --- a/src/services/NextAPI.js +++ b/src/services/NextAPI.js @@ -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', }, });