Create Next.js Request Logger (middleware, edge functions, redis)
Vložit
- čas přidán 16. 07. 2024
- Next.js middleware is best place to add logging to your Next js application. Middleware runs before each request and is run as edge function. In this video you will learn how to save data to Redis database with Next.js edge functions by building a request logger middleware.
Check out Upstash: bit.ly/UPSTASH
Request logger repo: github.com/tumetus/nextjs-req...
Learn Programming (Skillshare FREE trial): skl.sh/3cYxUP5
My courses:
React basics: skl.sh/2XAKn7u
HTML & CSS for beginners: skl.sh/34wvGUH
Draft.js basics: skl.sh/3cJ5Hw4
Connect with me:
Website: tuomokankaanpaa.com
My newsletter: tuomokankaanpaa.com/newsletter
Twitter: / tumee
Skillshare: www.skillshare.com/r/user/tume
Timestamps
00:00 What this video is about
00:46 Steps we take
01:39 Creating the middleware
03:28 Logging the data
05:42 Upstash Redis
06:52 Setting up Redis database
08:39 Connecting Next.js app to Redis
10:27 Saving data to Redis with REST api
15:01 Viewing log entries
16:27 Fetching data from Redis database
#nextjs #middleware #redis - Věda a technologie
Tuomo great video and I was looking for this solution. I also liked the whole video structure and walkthrough of what exactly you are doing. Subscribed. Keep it up with the videos.
Glad to hear, thank you!
Very intereesting video!
Cheers!
very good, thx.
Cheers!
Great tutorial
Cheers!
Kiitos for the video🎉
Cheers!
I want to connect Redis in the middleware without using uptash/redis. I want to use regular Redis connect process
Great tutorial. However how do you log the request body? I keep getting null even when i print to console? Same with the response body
Is it possible to connect normal Redis through middleware??? As I don't want to use upstash.
thanks, regard from berotot
Cheers!
@@TuomoKankaanpaa i'm really thankful man, thank you again. ur video is so helpful.
did you know berotot by any chance?
I’m super glad to hear that! I do not know unfortunately