Building a Mock API in React

Поділитися
Вставка
  • Опубліковано 7 бер 2024
  • 🚀 Project React → cosden.solutions/project-react
    Join The Discord! → discord.cosdensolutions.io
    VSCode Theme | Font → Material Theme Darker | Menlo, Monaco "monospace"
    In this video I will show you how I built a Mock API in React for my new React course, Project React. This mock API is built using axios, and functions exactly like a real API. You can fetch data, get responses, and handle loading and error states. The only difference is that the data is not coming from an endpoint, but rather from localStorage. This is a really cool way to learn how to fetch data in React without managing your own backend and database!

КОМЕНТАРІ • 28

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

    You’re definitely the best. Keep it up!!! Other devs don’t even talk about tests. Bravo!!!

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

    Really excited for your project react course🔥

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

    Great initiative waiting for this😊

  • @realbigsquid
    @realbigsquid 3 місяці тому +2

    Lolz from the guy who learned the hard way, this is pretty cool.

  • @OffroadTreks
    @OffroadTreks 3 місяці тому +2

    This is smart, becuase I usually get dropped into projects where someone else is setting up the API or dealing with data warehouse.

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

      That's exactly the goal! To simulate a real-world project

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

    Awesome thank you bro

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

    In this course add redux also ,it helps both ways hooks and redux concepts ,add many filters and check boxes to help further.

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

    Nice way to explain. Mocks inside the application are good for learning projects, but how do you handle live projects? Isn't keeping mocks outside the code a better approach? Like MockServer or Requestly.

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

    Covering just basics are all the advanced topics in your roadmap ? will you cover react query (please do )

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

      React Query is in part 2 which is coming a little later!

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

      cool best of luck waiting for the course desperately, some PPP for india and student discount would be graceful @@cosdensolutions

  • @ugogalliano1176
    @ugogalliano1176 3 місяці тому +2

    Hi Cosden good work!
    Sorry but i think that you can avoid all this work, with the json-server package, right ?

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

      Absolutely

    • @cosdensolutions
      @cosdensolutions  3 місяці тому +2

      Yeah you could, but you'd still have to implement auth yourself. Also, I wanted to show how an API backend would look like for those who want to learn in a safe and easy way

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

    can you tell me if there are any fetch request in the network tab? i didn't get it

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

    Will you be using ts?

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

      Not for this one. Wanted to make it accessible to everyone

  • @mutasimahmed8975
    @mutasimahmed8975 3 місяці тому +2

    when is it comping, ?

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

    Any Next.js course?

  • @onceUpon-A-Mic
    @onceUpon-A-Mic 3 місяці тому

    How much is this course?

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

    msw is better

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

      Produces the same result tbh, you won't directly touch this anws but its there for the curious ☺️