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
Welcome! Unfortunately, you donโt have access to this lesson. To get access, please purchase the workshop or enroll in Magical Dev School.
Unlock this lesson