ip tracker app

Solution retrospective
i would appreciate feedback on where i can improve the code and refactor it
Please log in to post a comment
Log in with GitHubCommunity feedback
- @fazzaamiarso
Hello Ebube! Nice work!
I have a quick improvements you can make.
function request(parameter) { const BASE_URL = `https://geo.ipify.org/api/v2/country,city?apiKey=${API_KEY}; const params = parameter ? `&${parameter.name}=${parameter.value}` : ' '; fetch(`${BASE_URL}${params}`) .then((res) => res.json()) .then((res) => setServerData(res)); }
I hope it helps! Cheers!
Marked as helpful
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord