Resting axios para o backend
This commit is contained in:
parent
b5d84d4c21
commit
62aa080d3d
2 changed files with 3 additions and 1 deletions
|
|
@ -30,6 +30,8 @@ export default function IndexPage() {
|
|||
try {
|
||||
setLoading(true);
|
||||
const { data } = await api.post("/auth/login", { email, password });
|
||||
|
||||
console.log(data.accessToken);
|
||||
setAuthToken(data.accessToken);
|
||||
} catch (err: any) {
|
||||
const message = err.response?.data?.error ?? "Erro ao fazer login.";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
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({
|
||||
baseURL: BASE_URL,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue