IP Address Tracker w/ vercel's serverless function

Solution retrospective
I used vercel's serverless function backend stuff here for the first time. Decided to try free ip-api.com
to avoid all the api-keys hassle, but it lead to two problems:
- My adblocker blocked access to ip-api.com
- After the first deploy to vercel I found out that it's forbidden to fetch via
http
when you are on the encryptedhttps
site.
I thought that a bit of backend should solve both problems and it did.
Apparently there is no native fetch
in node.js so I thought it's a good moment to try axios
. This solution uses both, axios
on the backend and fetch
on the front.
At first I tried using Leaflet.js but it looked very blurry with my 125% scaled ui. I went with Yandex maps as the easiest option with no api-keys needed.
Also made a couple of custom hooks for the first time!
I'd appreciate any feedback on my api or react code.
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on turtlecrab's solution.
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