PROBLEMAS DE CONEXÃO NA API (AXIOS) #1730
Replies: 16 comments
-
Primeiro tenta usar o ip da máquina ao invés de localhost. Segundo faz sua chama a api com uma função async e usando try catch. |
Beta Was this translation helpful? Give feedback.
-
Obrigado por vir me ajudar Rafael! |
Beta Was this translation helpful? Give feedback.
-
async function loadDevs() {
|
Beta Was this translation helpful? Give feedback.
-
Tentei fazer a sua primeira alternativa e não funcionou. |
Beta Was this translation helpful? Give feedback.
-
tenta fazer assim api.get('').then(resp => console.log(resp)).catch(err => console.log(err)) |
Beta Was this translation helpful? Give feedback.
-
Continua o erro.....!!!! |
Beta Was this translation helpful? Give feedback.
-
manda o código completo em um gist |
Beta Was this translation helpful? Give feedback.
-
OK! |
Beta Was this translation helpful? Give feedback.
-
BACKEND: https://github.com/julioaze/radar |
Beta Was this translation helpful? Give feedback.
-
https://github.com/julioaze/mobile/blob/master/src/pages/Main.js#L37 usa await |
Beta Was this translation helpful? Give feedback.
-
Como deveria ficar ett?? |
Beta Was this translation helpful? Give feedback.
-
Sou novo no React teria como você me mandar o codigo..... se não for pedir mto. |
Beta Was this translation helpful? Give feedback.
-
Entra nesse slack https://react-brasil-slack.herokuapp.com/ e manda as dúvidas no channel #general que ajudamos por lá, fica mais fácil. |
Beta Was this translation helpful? Give feedback.
-
@dbadaro717 Cara, eu percebi que vc está utilizando HTTPS no back e HTTP no front, talvez seja isso, troca e tenta novamente, ve se corrigiu |
Beta Was this translation helpful? Give feedback.
-
Pode ser alguma coisa voltando errado no backend. Na hora que você ta tentando consultar, comenta tudo e retorna um |
Beta Was this translation helpful? Give feedback.
-
Primeiro testa no Insomnia / Postman as suas requisições.... Deve se lembrar que o a verificação do certificado SSL deve estar desabilitada, caso não haja o mesmo. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Boa tarde!
Estou tendo problemas na conexão com a api, meu api,js está assim:
import axios from 'axios';
const api = axios.create({
baseURL: "http://localhost:3333/",
});
export default api;
Tem aparecido os seguinte erros:


Alguém pode me ajudar??
Beta Was this translation helpful? Give feedback.
All reactions