add axios

This commit is contained in:
andrzej 2024-06-03 18:20:33 +02:00
parent cc589e48ac
commit 473dab2b35
1 changed files with 11 additions and 2 deletions

View File

@ -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 (
<>