This Fixes CORS

Поділитися
Вставка
  • Опубліковано 21 вер 2024

КОМЕНТАРІ • 23

  • @colbyfayock
    @colbyfayock  Місяць тому

    Learn how to build a full stack Next.js app in my upcoming course: colbyfayock.com/course

  • @LeHarT99
    @LeHarT99 3 місяці тому +4

    Bro you just saved me, THANK YOU!. Suscribed and liked this video

    • @colbyfayock
      @colbyfayock  3 місяці тому +1

      happy to hear that! 🙌 and thanks for the sub 😁

  • @nemeziz_prime
    @nemeziz_prime 3 місяці тому +1

    Amazing video as usual! Keep going 💪🏻

  • @notrab
    @notrab 3 місяці тому

    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  3 місяці тому

      ohhh thats interesting! i never thought about rewrites from a billing perspective, is that measured in bandwidth?

  • @LearnAlongFaizan
    @LearnAlongFaizan 2 місяці тому

    Great video,
    Please make complete tutorial on authjs v5, rolebased, customer cookie, client side validations

    • @colbyfayock
      @colbyfayock  2 місяці тому +1

      thanks for the idea!

    • @LearnAlongFaizan
      @LearnAlongFaizan 2 місяці тому

      @@colbyfayock I hope so you've started making the video, because I've turned on your notification.

  • @kenshinhimura3140
    @kenshinhimura3140 3 місяці тому

    He became my friend now

  • @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

  • @nitinmungilwar659
    @nitinmungilwar659 3 місяці тому

    Great Colby 👍

  • @alvingultiano519
    @alvingultiano519 Місяць тому

    damn this one is really something :D

  • @colbyfayock
    @colbyfayock  3 місяці тому

    Get fresh tutorials and other free content straight to your inbox! colbyfayock.com/news

    • @CricMaster-oo6uf
      @CricMaster-oo6uf 3 місяці тому

      please make a video for educating like crud app using cloudinary and graphql

    • @colbyfayock
      @colbyfayock  3 місяці тому

      @@CricMaster-oo6uf hey thanks for the idea, will keep it in mind!

  • @v1d300
    @v1d300 3 місяці тому

    So I never needed the cors npm package?

    • @colbyfayock
      @colbyfayock  3 місяці тому +1

      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