Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

IP Address Tracker w/ vercel's serverless function

#axios#fetch#react#styled-components#typescript
turtlecrab 550

@turtlecrab

Desktop design screenshot for the IP Address Tracker coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
  • API
3intermediate
View challenge

Design comparison


SolutionDesign

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:

  1. My adblocker blocked access to ip-api.com
  2. After the first deploy to vercel I found out that it's forbidden to fetch via http when you are on the encrypted https 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.

Community feedback

Please log in to post a comment

Log in with GitHub
Discord logo

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