From 473dab2b357ccff90e0a7a910337b64726d4f3c8 Mon Sep 17 00:00:00 2001 From: andrzej Date: Mon, 3 Jun 2024 18:20:33 +0200 Subject: [PATCH] add axios --- src/App.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 4826238..bd70ccb 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,8 +1,17 @@ -import { useLayoutEffect, useState } from 'react' +import { useState } from 'react' +import axios from 'axios' import './App.css' +const [token, setToken] = useState("") + +const API = axios.create({ + baseURL: "http://localhost:3000/", + headers: { + "Content-Type": "application/json; charset=UTF-8", + "Authorization": "secret_token " + token + } +}) function App() { - const [token, setToken] = useState("") return ( <>