Essential CSS
JavaScript Roadmap
Learn JavaScript
Mastering Web Typography
Practical Astro
Understanding Async JS
Unorthodox Tailwind
API Masterclass
Build and Deploy
The Beginner Freelancer
Real World Node
Profile Billing Logout
Real World Node
Lesson Plan
  1. Workshop Recordings
    1. ๐Ÿ“น Understanding Node and Express
    2. ๐Ÿ“น Creating a traditional server
    3. ๐Ÿ“น Building API servers
    4. ๐Ÿ“น Create, Read, Update, and Delete APIs with real databases
    5. ๐Ÿ“น Handling user flows
    6. ๐Ÿ“น Testing your app and database with Vitest
    7. ๐Ÿ“น Testing Middlewares and APIs โ€” including Mocking
    8. ๐Ÿ“น Changing and resetting passwords

๐Ÿ“น Building API servers

1m:13s
23m:5s

This session covers everything you need to begin building robust API servers. It includes:

  • Understanding Rest Structure
  • Handling errors with Express
  • API Versioning
  • Express Routing
  • โ€ฆ and many other foundational topics.

Finally, as a preparation for the next step, youโ€™ll learn how to properly set up your Express project for real โ€” so you can test your servers and databases easily in the future.

Note

We wonโ€™t be handling CORS issues in this series since weโ€™re using the same origin in this series.

If you faced CORS errors, or wish to learn to properly let other people use your API, consult the CORS lesson in Async JS and Rest API.

Source Code

Hereโ€™s a link to the Github Repository.

Timestamps

  • 0:00 Introduction and my usual stack nowadys
  • 1:00 Recap from the previous session
  • 2:00 Handling Errors in Express
  • 5:21 API Versioning
  • 8:00 Express Routing
  • 15:00 Importing routes the easy way
  • 16:50 Checking that the API is working
  • 19:00 Debugging routing errors
  • 28:00 Passing data from the frontend to the server
  • 37:00 Setting up Mongoose (a MongodB ORM) in a production-ready way
  • 43:50 Using MongoDB Compass to see your database
  • 44:50 Installing and running MongoDB on your local computer
  • 46:16 Connecting to the database
  • 48:00 What weโ€™re doing in the next session
  • 49:50 Question and Answers