Resting axios para o backend

This commit is contained in:
Rayan Konecny 2026-04-28 00:23:49 -03:00
parent b5d84d4c21
commit 62aa080d3d
2 changed files with 3 additions and 1 deletions

View file

@ -30,6 +30,8 @@ export default function IndexPage() {
try { try {
setLoading(true); setLoading(true);
const { data } = await api.post("/auth/login", { email, password }); const { data } = await api.post("/auth/login", { email, password });
console.log(data.accessToken);
setAuthToken(data.accessToken); setAuthToken(data.accessToken);
} catch (err: any) { } catch (err: any) {
const message = err.response?.data?.error ?? "Erro ao fazer login."; const message = err.response?.data?.error ?? "Erro ao fazer login.";

View file

@ -1,6 +1,6 @@
import axios from "axios"; import axios from "axios";
const BASE_URL ="http://179.15.15.93:4000"; const BASE_URL ="http://175.15.15.93:3000";
export const api = axios.create({ export const api = axios.create({
baseURL: BASE_URL, baseURL: BASE_URL,