In this video I'll show you the power of Vercel Edge Functions Building a Geolocation Country Block App and how them allow us to have both speed and performance taking the best from Static Site Generation and Server Side Rendering.
Would you like to virtually invite me for an Italian Espresso Coffee?! ☕
Buy me a Coffee 👉 https://www.buymeacoffee.com/theItali...
Now you might ask...Why am I seeing a Pinapple Pizza on the screen?
Well we are going to code a Next.js App that allow user, from all over the world, except the ones sending requests from Italy, to ideally order a Pineapple Pizza...
Because you know...in an ideal world Pineapple Pizza is not legal in Italy 🤣
We will exploit the power of Vercel Edge Functions deploying globally a Middleware to Vercel Edge Network.
Resources:
➡ https://nextjs.org/docs/api-reference...
Free software used recording this video:
Free VPN ➡️ https://protonvpn.com/
#nextjs #nextmiddleware #edgefunction #verceledgefuntion #nextedgefunction
Chapters
00:00 Intro
01:16 Creating the frontend with Next.js and Tailwind CSS
14:37 Push to Github and deploy to Vercel
19:09 Creating _middleware.ts and the logic to Geolocation Country Block
35:52 Conclusion