Next.js 13 API Route Handlers FULL CRUD

preview_player
Показать описание


Other videos:
Рекомендации по теме
Комментарии
Автор

thanks for the video, was struggling to get my post method to work and this resolved it!

Brian-elit
Автор

I write this before watching the video.
I just spent 2 days trying to figure this out... I really hope this will help me make things work !

ibrahimelmhadri
Автор

Ty, bro. I was satysfied by u'r solution

Stacardi_
Автор

thank you very much!!! you saveme a lot of time!

raphauy
Автор

bro it works thank you, now i can continue

briandacallos
Автор

You are singe handedly responsible for saying my career and I can't thank you enough

xGalasko
Автор

do you have any links or references to testing route handlers with jest?

JohnnieHarris
Автор

Hi thanks for the video. If this still isn't working for those reading, you can handle the OPTIONS request directly in your api route.ts file. Basically just include the same code shown in the video by defining a new options function:

export async function OPTIONS(request: Request) {
const response = new NextResponse(null);

response.headers.set("Access-Control-Allow-Origin", "*");
response.headers.set(
"Access-Control-Allow-Methods",
"GET, POST, PUT, DELETE, OPTIONS"
);
response.headers.set(
"Access-Control-Allow-Headers",
"Content-Type, Authorization"
);
response.headers.set("Access-Control-Max-Age", "86400");

return response;
}

For some reason, putting it in the middleware didn't work for me. Will come back and change this when Next.js fix the issue.

Thanks,
Tom

tomnewton
Автор

When trying to deploy in Vercel I’m getting error and can’t deploy when using route handler in a page

juventusi
Автор

It was nice of to introduce to us your awesome tool but we would love it if we could use it straightaway without login and stuff because I, personally, was fed up searching for the solution. Anyway, your tutorial helped!

clumsysandesh
Автор

Thanks, wish I found this before I lost my hair a week ago...lol. Thanks

craigleppan
Автор

Bro ca you please tell me where to get the lastest documents. in their official website all documentation are old

joydeepbhowmik
Автор

Hahahahah oh my god i relate to the first 15 seconds of your videos so much

xGalasko
Автор

I've tried signing up to nextchat but Global Prompt Library is not showing... How can I fix it?

stanislavus
Автор

Where is error handling and sending statuses other than 200?

dyktatorwood
Автор

Day 3 of trying to use next http route methods.
Im not sure who I am any more...
im not sure ...
.. what ive become.
*dies*

On a serious note VERCEL MAKE BETTER DOCUMENTATION.

Also thanks for making a next js chatGPT implementation. I will definitely use that.

This video just saved me probably several days of SUFFERING and debugging

nebuchadnezzarii
Автор

next js 13 really bad, cant get req.body, it force to use req.json

makisetakashi
Автор

is this still up relevant? or did things change ?

Light-nnhn
Автор

nextjs documentation in this regard is very less:(

nikhil
Автор

It's now $20 per month after trial. :(

victorkimura