fix: 🐛 Fix ip loading and page name

This commit is contained in:
Louis Gallet 2023-06-27 15:47:30 +02:00
parent c346951d3b
commit 4bd5e16f0e
Signed by: lgallet
SSH Key Fingerprint: SHA256:qnW7pk4EoMRR0UftZLZQKSMUImbEFsiruLC7jbCHJAY
2 changed files with 4 additions and 4 deletions

View File

@ -4,7 +4,7 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title> <title>Garfield IP</title>
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>

View File

@ -7,9 +7,9 @@ function App() {
const [ip, setIP] = useState('') const [ip, setIP] = useState('')
const getData = async () => { const getData = async () => {
const res = await axios.get('https://api.ipify.org?format=json'); const res = await axios.get('https://ifconfig.louisgallet.fr/ip');
console.log(res.data.ip) console.log(res.data)
setIP(res.data.ip); setIP(res.data);
} }
useEffect(() => { useEffect(() => {