API Routes with Next.js 14 - Course part 10
Вставка
- Опубліковано 4 жов 2024
- Get access to my private courses 👉 dub.link/devco...
Thanks for watching! Please subscribe ❤️
Guillaume
👇
Read my adventures
👉 dub.link/newsl...
Join my Discord
👉 dub.link/discord
Book a coaching
👉 dub.link/guill...
Looking for a repository?
👉 dub.link/repos
Visit my website
👉 dub.link/codew...
Install my package UserItem
👉 dub.link/useritem
💥 TOP VIDEOS
Learn Nuxt
👉 dub.link/nuxt
Learn Nextjs
👉 dub.link/next
Learn Supabase
👉 dub.link/supabase
⚙️
• Theme that I use: VSCode Dark
• VSCode Icons package: miguelsolorio.symbols
• Snippets: my own, coming soon :)
Thank you :)
Guillaume
Thanks, this video helped me a lot. Not even the official NextJS focumentation had a proper explanation of how to make routes and such.
Explained more in 9 minutes than 4 hours big project video,
thanks a lot guillaume
Very helpful, thanks! The official Next docs are a lot to read through. So this is very helpful to have it in quick video format. Very knowledge packed video!
Thanks my friend ! I’ll keep improving
Quick note: I've made a mistake, method is not in header but over header in fetch call 🚀
Hey, thanks mate. I've been finding the solution to some error related to API routes & your video literally solved it for me. Thanks a lot. Stay blessed! Highly appreciate your work!
For QUERIES:
async function GET(req:NextRequest){
console.log(req.nextUrl.serachParams.get("keyword"))
}
Thank you so much, I felt like I was going insane trying trying to figure out nextjs' api routes.
The first main problem was realizing that you have to name each file for folder-based routes, as route.ts | js
Nice !
Thanks for the explanation. It's strange that right now, in official documentation API routes are covered only for "pages router", nothing said about App router, but however, you did well showing good use cases.
This is extremely accurate!
I didn't find any simple short video that explains rest api in next js, and here we are i found your video and its also new.
I thanks you alot ❤
I recommend creating a video or playlist where you explain how to make full rest api with crud, images, files, auth and db
Or you know , don't use db or external packages, instead use json files
So that it remain a next next tutorial xD
Everything inside Next.js 13 or with another backend framework? 🥰 thanks for comments my friend
@codewithguillaume next.js 13, in the style of this great video, but more full
Thank you so much!! A few minutes of my time watching this solved hours worth of troubleshooting.
Thanks my friend ! Checkout my masterclass coming soon
Thanks for the video. I did not find the context thing anywhere else which I needed
The current docs does not explain this, they explain something that does not work. Use handlers
True they should update it
Thanks so much Guillaume, after hours of searching, this video solved my problem!
EXCELLENT video. It finally is starting to make sense to me. Next time do a video with Prisma so I can follow
Thanks for this. This helped more than the docs
Nope my friend
Please, keep doing this great king of job. Tks
Thanks a lot mate, very informative and you get a new subscriber
Thanks man!
Bro your teaching skill is amazing even I don't understand English
Thanks bro! See you soon and subscribe if you didn’t yet !
Vraiment
Excellente video Guillaume! Merci!
👍😉
that one video talks no BS straight to the point. Thanks, Subscribed you!
This was super helpful. Thanks Guillaume! Great video ✨
thank you, finally someone who explains well!!!
Very clear explanation. Had to subscribe.
thanks this video helped a lot
"That's what i'm looking for. Thanks ."
very well explained and helpful, Thanx bro
Thank you! clear explantion as always
Thanks my friend
thankyou for teaching sir
Simple and straight to the point. Love it. Thank you so much!
Great, concise explanation thanks!
thanks
Thanks a lot!
You just got yourself a new subscriber. ❤
Welcome my friend 🙌
Hey, what is the difference between api routes and route handlers and which one might you use in next js 14?
Thanks for sharing, very helpful
Thanks!! You saved my life!!!
Thankyou bro
With server-actions, do we still need api routes?
just that I was looking
can you explain export const dynamic = 'force-dynamic'; and the build process. from what I found out today that route will be prerendered in the build process because its a static route. I had to use the 'force-dynamic' const to make it a dynamic rooute.
ofcourse now I'm searching the web to figure out why my response in production is an old version. in localhost:3000 if i update my sql query to pull different data, the route response will reflect that updated data, but not in production. kinda frustrating its not working like a traditional PHP request.
Thanks you .
just one question: why? Why do we need this API if we can do like anything in server components?
Server components / API are 2 différents approaches. Depends on how you want to architecture your project !
Really good video!
Thanks my friend it means a lot
how would I write unit tests for a function like this?
great tut
Thanks my friend
Does next have any type for context? I'm talking about the api context. Couldn't find anything in their docs. Thanks
Good question probably ask on Twitter on Nextjs community
Hello can you tell me which theme you're using in your vscode?
thanks!
Description 😉👍
how to create an API with JWT authentication in Nextjs
In case when we need to get only one user by params(id), you fetch all users and then find selected user. Is this good because we can have more than 1000 users and our performance would be bad if we fetch that number of users.Maybe is better with RESP API to filter call to backend and get only that user
Yep you can do this. This was just an example here
thank you
Enjoy my friend !
What is the site he's using to monitor the api data?
Hi dear, can you please tell me which AI tool you are using?
how do you call async await inside client compoenent i thought it s not possible , only if it s a server component ?
How to use this api route inside the nextjs app. for example im on page.tsx and i want under click button call post method ?
Thanks for mentioning that the file has to be named route.ts...
No problem man
i love you u save me
How do i implement API authentication? Sending request from postman for protected route
Dear Sir you fetch external api can you make small video that create custom api in api folder and fetch internal api and show in browser just 3 or 4 items fetch i tried alot of videos everyone fetching external apis only 1 youtuber create custom api and fetch internal api but i donot understand can you make?
What if I use js instead of react?
You can !
When i depoloy the app it's a problem of cors