Quick note: I've made a mistake, method is not in header but over header in fetch call 🚀
@codewithguillaume Жыл бұрын
For QUERIES: async function GET(req:NextRequest){ console.log(req.nextUrl.serachParams.get("keyword")) }
@AmodeusR9 ай бұрын
Thanks, this video helped me a lot. Not even the official NextJS focumentation had a proper explanation of how to make routes and such.
@briancooper17892 ай бұрын
Excellent tutorial! I've watched several videos about both Next JS APIs, and server requests in general. This one is by far the best I've seen for both topics.
@sarhan_104 Жыл бұрын
Explained more in 9 minutes than 4 hours big project video, thanks a lot guillaume
@LyleLundy9 ай бұрын
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!
@codewithguillaume9 ай бұрын
Thanks my friend ! I’ll keep improving
@clickbaitpolice97922 ай бұрын
you've earned a sub mate. I've been so scared of all this postman and api stuff. you made it super simple
@ansarqazi43778 ай бұрын
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!
@yipmongАй бұрын
Thank you so much, you saved me from alot of stress after goin through the documentations, copilot and chatgpt couldnt solve the issue until i stomped on your channel
@WinchesterD8 ай бұрын
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.
@georgesmaroun1406 Жыл бұрын
Excellente video Guillaume! Merci!
@codewithguillaume Жыл бұрын
👍😉
@Devin-tf1es7 ай бұрын
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
@codewithguillaume7 ай бұрын
Nice !
@PetriikVx Жыл бұрын
Thanks so much Guillaume, after hours of searching, this video solved my problem!
@MertMusaTemel6 ай бұрын
Thanks a lot mate, very informative and you get a new subscriber
@codewithguillaume6 ай бұрын
Thanks man!
@NickTub37 ай бұрын
Thank you so much!! A few minutes of my time watching this solved hours worth of troubleshooting.
@codewithguillaume7 ай бұрын
Thanks my friend ! Checkout my masterclass coming soon
@atejap Жыл бұрын
Please, keep doing this great king of job. Tks
@johnmuku17736 ай бұрын
Thanks for this. This helped more than the docs
@codewithguillaume6 ай бұрын
Nope my friend
@clasicalsingingfans88088 ай бұрын
that one video talks no BS straight to the point. Thanks, Subscribed you!
@jeremy0x5 ай бұрын
This was super helpful. Thanks Guillaume! Great video ✨
@efratywestchester92915 ай бұрын
thank you, finally someone who explains well!!!
@lrnngman2942 Жыл бұрын
Bro your teaching skill is amazing even I don't understand English
@codewithguillaume Жыл бұрын
Thanks bro! See you soon and subscribe if you didn’t yet !
@DynamicCorp2429 ай бұрын
Vraiment
@jdm465710 ай бұрын
EXCELLENT video. It finally is starting to make sense to me. Next time do a video with Prisma so I can follow
@JohnKimani-d6z5 ай бұрын
Very clear explanation. Had to subscribe.
@badis6717 Жыл бұрын
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
@badis6717 Жыл бұрын
Or you know , don't use db or external packages, instead use json files So that it remain a next next tutorial xD
@codewithguillaume Жыл бұрын
Everything inside Next.js 13 or with another backend framework? 🥰 thanks for comments my friend
@badis6717 Жыл бұрын
@codewithguillaume next.js 13, in the style of this great video, but more full
@toomanyarguments Жыл бұрын
With server-actions, do we still need api routes?
@zyx846310 ай бұрын
thanks this video helped a lot
@elhadi98869 ай бұрын
very well explained and helpful, Thanx bro
@GamingWithLag4 ай бұрын
Thanks for the video. I did not find the context thing anywhere else which I needed
@tamerahmed986010 ай бұрын
Thank you! clear explantion as always
@codewithguillaume10 ай бұрын
Thanks my friend
@ssojyeti29 ай бұрын
Great, concise explanation thanks!
@unnamedcodes7 ай бұрын
You just got yourself a new subscriber. ❤
@codewithguillaume6 ай бұрын
Welcome my friend 🙌
@LorraineCai7 ай бұрын
Thanks!! You saved my life!!!
@haraldlons11 ай бұрын
Really good video!
@codewithguillaume11 ай бұрын
Thanks my friend it means a lot
@fre609011 ай бұрын
how would I write unit tests for a function like this?
@edutechpty11 ай бұрын
Thanks a lot!
@UAng-ro9kt Жыл бұрын
Thanks for sharing, very helpful
@abe66154 ай бұрын
What is the site he's using to monitor the api data?
@anthonyfarias321 Жыл бұрын
The current docs does not explain this, they explain something that does not work. Use handlers
@codewithguillaume Жыл бұрын
True they should update it
@muthupandideivamsanmugam17748 ай бұрын
thankyou for teaching sir
@VishalSingh-ls4re5 ай бұрын
"That's what i'm looking for. Thanks ."
@ionutcirja712111 ай бұрын
Does next have any type for context? I'm talking about the api context. Couldn't find anything in their docs. Thanks
@codewithguillaume11 ай бұрын
Good question probably ask on Twitter on Nextjs community
@brandonm83852 ай бұрын
Thanks! I wish I found this a little earlier lol. It is difficult finding good examples on v14, especially with dynamic routes.
@lorddesert Жыл бұрын
Simple and straight to the point. Love it. Thank you so much!
@xmaxfuture11 ай бұрын
great tut
@codewithguillaume11 ай бұрын
Thanks my friend
@maxkosh48393 ай бұрын
just one question: why? Why do we need this API if we can do like anything in server components?
@codewithguillaume3 ай бұрын
Server components / API are 2 différents approaches. Depends on how you want to architecture your project !
@bikibalami27 күн бұрын
Took a whole next.js bootcamp. Never once was mentioned that the api folder works like this. Like its an active running server. Thats why my app was not building cause i just treated it as functions to fetch data from servers.
@webmandman Жыл бұрын
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.
@arvindknit315 ай бұрын
Hi dear, can you please tell me which AI tool you are using?
@PandiyanM25 күн бұрын
Well and clear.
@ohmegatech6663 ай бұрын
OK but how do you call the API request in production once you build to Vercel? I just get a HTML response saying Authentication Required. How do you authenticate an API call from Postman to a Next app?
@AlessiaCaraFans6 ай бұрын
how do you call async await inside client compoenent i thought it s not possible , only if it s a server component ?
@AndresMartinez-se9zl6 ай бұрын
Hey, what is the difference between api routes and route handlers and which one might you use in next js 14?
@djchoodaofficial Жыл бұрын
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
@codewithguillaume Жыл бұрын
Yep you can do this. This was just an example here
@itsRahul-dd4xm5 ай бұрын
Thankyou bro
@TahaECHCHOUAL9 ай бұрын
thanks
@manassesraimundo5 ай бұрын
how to create an API with JWT authentication in Nextjs
@dominikyszkowski766311 ай бұрын
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 ?
@sergiohidalgorobles8351 Жыл бұрын
just that I was looking
@AbuBakr18 ай бұрын
How do i implement API authentication? Sending request from postman for protected route
@tandoku9133Ай бұрын
Why is localhost:3000/api can access pages/api/route.ts? I thought it would be localhost:3000/api/route. Sorry Im confused.
@techjdx3 ай бұрын
Thanks you .
@adammuhtarif9 ай бұрын
When i depoloy the app it's a problem of cors
@감기여요 Жыл бұрын
What if I use js instead of react?
@codewithguillaume Жыл бұрын
You can !
@PeriklesPeriklesoglu10 ай бұрын
thank you
@codewithguillaume10 ай бұрын
Enjoy my friend !
@patrikmeijer74374 ай бұрын
Thanks for mentioning that the file has to be named route.ts...
@codewithguillaume4 ай бұрын
No problem man
@SalmanIqbal-kr8mh3 ай бұрын
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?