No video

This Fixes CORS

  Рет қаралды 2,335

Colby Fayock

Colby Fayock

Күн бұрын

Learn how to fix CORS errors and enable cross-origin requests in an API endpoint.
We'll walk through why CORS may be blocking a request, how we can set up response headers to control what origins can make requests to an API endpoint including all and several origins, as well as how to set up OPTIONS endpoints using Vercel Functions to respond to preflight requests.
🧰 Resources
Tutorial: spacejelly.dev...
Starter: github.com/col...
Code: github.com/col...
📺 KZfaq: kzfaq.info...
🐦 Twitter: / colbyfayock
📹 Twitch: / colbyfayock
✉️ Newsletter: www.colbyfayoc...
🎥 What I Use: www.colbyfayoc...
#colbyfayock #api #cors #vercel #webdevelopment

Пікірлер: 23
@colbyfayock
@colbyfayock 28 күн бұрын
Learn how to build a full stack Next.js app in my upcoming course: colbyfayock.com/course
@LeHarT99
@LeHarT99 2 ай бұрын
Bro you just saved me, THANK YOU!. Suscribed and liked this video
@colbyfayock
@colbyfayock 2 ай бұрын
happy to hear that! 🙌 and thanks for the sub 😁
@notrab
@notrab 2 ай бұрын
Nice video @colbyfayock! Another workaround I've been trying lately (but need to measure bandwidth usage) is by adding a `rewrites` option to my Next.js config. The source would be the path I want to post to (could be your API), then the destination the original. I've been using it for file uploads, so this could get expensive $$$$
@colbyfayock
@colbyfayock 2 ай бұрын
ohhh thats interesting! i never thought about rewrites from a billing perspective, is that measured in bandwidth?
@colbyfayock
@colbyfayock 2 ай бұрын
Get fresh tutorials and other free content straight to your inbox! colbyfayock.com/news
@CricMaster-oo6uf
@CricMaster-oo6uf 2 ай бұрын
please make a video for educating like crud app using cloudinary and graphql
@colbyfayock
@colbyfayock 2 ай бұрын
@@CricMaster-oo6uf hey thanks for the idea, will keep it in mind!
@nemeziz_prime
@nemeziz_prime 2 ай бұрын
Amazing video as usual! Keep going 💪🏻
@colbyfayock
@colbyfayock 2 ай бұрын
thank you!!
@LearnAlongFaizan
@LearnAlongFaizan Ай бұрын
Great video, Please make complete tutorial on authjs v5, rolebased, customer cookie, client side validations
@colbyfayock
@colbyfayock Ай бұрын
thanks for the idea!
@LearnAlongFaizan
@LearnAlongFaizan Ай бұрын
@@colbyfayock I hope so you've started making the video, because I've turned on your notification.
@bandekhoda7801
@bandekhoda7801 2 ай бұрын
Wait a minute isn't this a huge security issue in the browsers, that I can easily fetch from a website I just opened up and have that website URL as my origin? Does the IP also point to that website I'm fetching from (in the console) or is it my IP? Is the website allowed to not let people fetch using it's origin?
@colbyfayock
@colbyfayock 2 ай бұрын
i dont know that i completely follow your question, but: - yes you can theoretically go to your browser's console and create a same-site origin request to the website you're on - there are extra security guards that you can place, that larger websites often place, to prevent someone from abusing that, such as authentication, rate limiting, DDOS prevention, etc - im not sure what you mean by the IP question - by default, without CORS headers, you can not fetch from a website from another origin, this video shows how to do that in a way that you're not allowing ALL websites to make those requests, but only the ones that you choose
@kenshinhimura3140
@kenshinhimura3140 2 ай бұрын
He became my friend now
@colbyfayock
@colbyfayock 2 ай бұрын
💯
@nitinmungilwar659
@nitinmungilwar659 2 ай бұрын
Great Colby 👍
@colbyfayock
@colbyfayock 2 ай бұрын
thanks! 🙌
@alvingultiano519
@alvingultiano519 23 күн бұрын
damn this one is really something :D
@colbyfayock
@colbyfayock 23 күн бұрын
💯
@v1d300
@v1d300 2 ай бұрын
So I never needed the cors npm package?
@colbyfayock
@colbyfayock 2 ай бұрын
this is my first time seeing the cors package, but it looks like it's still a great and easy way to configure CORS specifically in an Express app, where im not sure that this would work inside of a serverless function? but if you wanted to avoid using CORS, you could use this technique to configure the headers yourself, which is partially what the package does
Generate a PDF in React
23:38
Colby Fayock
Рет қаралды 8 М.
Why You Shouldn't Nest Your Code
8:30
CodeAesthetic
Рет қаралды 2,7 МЛН
Dad Makes Daughter Clean Up Spilled Chips #shorts
00:16
Fabiosa Stories
Рет қаралды 2,6 МЛН
这三姐弟太会藏了!#小丑#天使#路飞#家庭#搞笑
00:24
家庭搞笑日记
Рет қаралды 83 МЛН
7 Days Stranded In A Cave
17:59
MrBeast
Рет қаралды 95 МЛН
Zombie Boy Saved My Life 💚
00:29
Alan Chikin Chow
Рет қаралды 27 МЛН
Pagination in React
29:05
Colby Fayock
Рет қаралды 2 М.
Best Way to Add Popup Modals in React
26:19
Colby Fayock
Рет қаралды 7 М.
You Don't Need a CMS - Use This Instead
28:55
Colby Fayock
Рет қаралды 20 М.
The Most Terrifying IQ Statistics | Jordan Peterson
10:54
The Iced Coffee Hour Clips
Рет қаралды 5 М.
I Am Done With Graph QL After 6 Years
31:41
ThePrimeTime
Рет қаралды 139 М.
Talking Tech and AI with Tim Cook!
16:33
Marques Brownlee
Рет қаралды 3 МЛН
Styling active links in next.js is tricker than you think
10:02
Colby Fayock
Рет қаралды 3 М.
`const` was a mistake
31:50
Theo - t3․gg
Рет қаралды 134 М.
Using My Python Skills To Punish Credit Card Scammers
7:13
Engineer Man
Рет қаралды 4,9 МЛН
Dad Makes Daughter Clean Up Spilled Chips #shorts
00:16
Fabiosa Stories
Рет қаралды 2,6 МЛН