Building a Mock API in React

Поделиться
HTML-код
  • Опубликовано: 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😊

  • @OffroadTreks
    @OffroadTreks 3 месяца назад +3

    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

  • @realbigsquid
    @realbigsquid 3 месяца назад +2

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

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

  • @brancode404
    @brancode404 3 месяца назад

    Any Next.js course?

  • @HolySl0w
    @HolySl0w 3 месяца назад

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

  • @mutasimahmed8975
    @mutasimahmed8975 3 месяца назад +2

    when is it comping, ?

  • @ostap787
    @ostap787 3 месяца назад

    Will you be using ts?

    • @cosdensolutions
      @cosdensolutions  3 месяца назад

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

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