Node.js: The Complete Guide to Build RESTful APIs

Mosh Hamedani, Software Engineer

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
208 Lessons (14h 60m)
    • 1. What is Node

      2:59
    • 2. Node Architecture

      3:01
    • 3. How Node Works

      4:23
    • 4. Installing Node

      2:31
    • 5. Your First Node Program

      2:19
    • 6. Node Module System

      0:28
    • 7. Global Object

      3:21
    • 8. Modules

      3:35
    • 9. Creating a Module

      4:43
    • 10. Loading a Module

      5:22
    • 11. Module Wrapper Function

      4:40
    • 12. Path Module

      4:08
    • 13. OS Module

      4:18
    • 14. File System Module

      4:50
    • 15. Events Module

      6:17
    • 16. Event Arguments

      3:08
    • 17. Extending EventEmitter

      8:01
    • 18. HTTP Module

      7:24
    • 19. Node Package Manager (NPM)

      3:41
    • 20. Package.json

      2:54
    • 21. Installing a Node Package

      3:33
    • 22. Using a Package

      3:20
    • 23. Package Dependencies

      3:18
    • 24. NPM Packages and Source Control

      3:51
    • 25. Semantic Versioning

      4:29
    • 26. Listing the Installed Packages

      2:10
    • 27. Viewing Registry Info for a Package

      2:45
    • 28. Installing a Specific Version of a Package

      1:05
    • 29. Updating Local Packages

      5:02
    • 30. DevDependencies

      1:51
    • 31. Uninstalling a Package

      0:40
    • 32. Working with Global Packages

      2:33
    • 33. Publishing a Package

      4:32
    • 34. Updating a Published Package

      1:55
    • 35. Building RESTful API's Using Express

      0:47
    • 36. RESTful Services

      5:57
    • 37. Introducing Express

      2:19
    • 38. Building Your First Web Server

      5:45
    • 39. Nodemon

      1:30
    • 40. Environment Variables

      3:13
    • 41. Route Parameters

      3:22
    • 42. Handling HTTP GET Requests

      4:45
    • 43. Handling HTTP POST Requests

      3:42
    • 44. Calling Endpoints Using Postman

      2:07
    • 45. Input Validation

      7:58
    • 46. Handling HTTP PUT Requests

      8:30
    • 47. Handling HTTP Delete Requests

      4:44
    • 48. Project - Build the Genres API

      1:18
    • 49. Express- Advanced Topics

      0:22
    • 50. Middleware

      2:48
    • 51. Creating Custom Middleware

      4:23
    • 52. Built in Middleware

      3:57
    • 53. Third-party Middleware

      3:55
    • 54. Environments

      4:06
    • 55. Configuration

      9:45
    • 56. Debugging

      6:54
    • 57. Templating Engines

      4:55
    • 58. Database Integration

      1:36
    • 59. Authentication

      0:29
    • 60. Structuring Express Applications

      7:44
    • 61. Project Restructure the App

      3:05
    • 62. Synchronous vs Asynchronous Code

      5:51
    • 63. Patterns for Dealing with Asynchronous Code

      3:07
    • 64. Callbacks

      5:59
    • 65. Callback Hell

      2:28
    • 66. Named Functions to Rescue

      4:41
    • 67. Promises

      8:37
    • 68. Replacing Callbacks with Promises

      3:31
    • 69. Consuming Promises

      5:31
    • 70. Creating Settled Promises

      2:49
    • 71. Running Promises in Parallel

      6:14
    • 72. Async and Await

      6:55
    • 73. Exercise

      5:56
    • 74. Introducing MongoDB

      2:00
    • 75. Installing MongoDB on Mac

      3:58
    • 76. Installing MongoDB on Windows

      5:39
    • 77. Connecting to MongoDB

      3:52
    • 78. Schemas

      3:48
    • 79. Models

      4:18
    • 80. Saving a Document

      3:33
    • 81. Querying Documents

      4:18
    • 82. Comparison Query Operators

      4:59
    • 83. Logical Query Operators

      2:01
    • 84. Regular Expressions

      3:20
    • 85. Counting

      0:49
    • 86. Pagination

      1:36
    • 87. Exercise 1

      7:57
    • 88. Exercise 2

      4:34
    • 89. Exercise 3

      3:19
    • 90. Updating a Document Query First

      3:35
    • 91. Updating a Document Update First

      6:14
    • 92. Removing Documents

      2:38
    • 93. Mongoose - Data Validation

      6:59
    • 94. Built in Validators

      4:54
    • 95. Custom Validators

      3:16
    • 96. Async Validators

      2:35
    • 97. Validation Errors

      3:37
    • 98. SchemaType Options

      5:56
    • 99. Project - Add Persistence to Genres API

      14:05
    • 100. Project - Build the Customers API

      6:59
    • 101. Restructuring the Project

      6:14
    • 102. Modelling Relationships

      7:45
    • 103. Referencing Documents

      3:51
    • 104. Population

      4:16
    • 105. Embedding Documents

      6:54
    • 106. Using an Array of Sub-documents

      4:31
    • 107. Project - Build the Movies API

      7:05
    • 108. Project - Build the Rentals API

      8:01
    • 109. Transactions

      8:45
    • 110. ObjectID

      7:03
    • 111. Validating ObjectIDs

      6:13
    • 112. A Better Implementation

      2:23
    • 113. Authentication and Authorization

      4:01
    • 114. Creating the User Model

      3:40
    • 115. Registering Users

      7:53
    • 116. Using Lodash

      5:21
    • 117. Hashing Passwords

      6:54
    • 118. Authenticating Users

      4:54
    • 119. Testing the Authentication

      2:42
    • 120. JSON Web Tokens

      5:04
    • 121. Generating Authentication Tokens

      3:18
    • 122. Storing Secrets in Environment Variables

      6:12
    • 123. Setting Response Headers

      3:46
    • 124. Encapsulating Logic in Mongoose Models

      7:11
    • 125. Authorization Middleware

      6:50
    • 126. Protecting Routes

      3:06
    • 127. Getting the Current User

      4:03
    • 128. Logging Out Users

      2:04
    • 129. Role-based Authorization

      5:43
    • 130. Testing the Authorization

      4:10
    • 131. Handling and Logging Errors

      3:02
    • 132. Handling Rejected Promises

      3:07
    • 133. Express Error Middleware

      4:40
    • 134. Removing Try Catch Blocks

      8:29
    • 135. Express Async Errors

      3:18
    • 136. Logging Errors

      6:36
    • 137. Logging to MongoDB

      4:11
    • 138. Uncaught Exceptions

      3:35
    • 139. Unhandled Promise Rejections

      7:23
    • 140. Error Handling Recap

      2:26
    • 141. Extracting Routes

      4:54
    • 142. Extracting the Db Logic

      3:22
    • 143. Extracting the Logging Logic

      2:11
    • 144. Extracting the Config Logic

      2:30
    • 145. Extracting the Validation Logic

      1:53
    • 146. Showing Unhandled Exceptions on the Console

      1:29
    • 147. What is Automated Testing

      2:40
    • 148. Benefits of Automated Testing

      2:37
    • 149. Types of Tests

      4:00
    • 150. Test Pyramid

      2:55
    • 151. Tooling

      2:15
    • 152. Writing Your First Unit Test

      5:00
    • 153. Testing Numbers

      6:36
    • 154. Grouping Tests

      1:51
    • 155. Refactoring with Confidence

      2:43
    • 156. Testing Strings

      3:24
    • 157. Testing Arrays

      5:50
    • 158. Testing Objects

      5:30
    • 159. Testing Exceptions

      7:25
    • 160. Continuously Running Tests

      1:43
    • 161. Exercise - Testing the FizzBuz

      5:28
    • 162. Creating Simple Mock Functions

      5:37
    • 163. Interaction Testing

      5:00
    • 164. Jest Mock Functions

      7:16
    • 165. What to Unit Test

      3:06
    • 166. Exercise

      7:39
    • 167. Integration Testing

      1:09
    • 168. Preparing the App

      2:18
    • 169. Setting Up the Test Db

      3:01
    • 170. Your First Integration Test

      5:44
    • 171. Populating the Test Db

      6:17
    • 172. Testing Routes with Parameters

      3:19
    • 173. Validating ObjectIDs

      3:31
    • 174. Refactoring with Confidence

      2:04
    • 175. Testing the Authorization

      2:39
    • 176. Testing the Invalid Inputs

      5:32
    • 177. Testing the Happy Path

      2:35
    • 178. Writing Clean Tests

      8:40
    • 179. Testing the Auth Middleware

      9:45
    • 180. Unit Testing the Auth Middleware

      6:14
    • 181. Code Coverage

      7:09
    • 182. Exercise

      0:26
    • 183. What is Test-driven Development

      2:54
    • 184. Implementing the Returns

      2:33
    • 185. Test Cases

      2:53
    • 186. Populating the Database

      7:14
    • 187. Testing the Authorization

      7:22
    • 188. Testing the Input

      3:42
    • 189. Refactoring Tests

      4:18
    • 190. Looking Up an Object

      3:04
    • 191. Testing if Rental Processed

      2:13
    • 192. Testing the Valid Request

      2:23
    • 193. Testing the ReturnDate

      4:15
    • 194. Testing the RentalFee

      4:50
    • 195. Testing the Movie Stock

      5:37
    • 196. Testing the Response

      3:36
    • 197. Refactoring the Validation Logic

      6:44
    • 198. Mongoose Static Methods

      6:12
    • 199. Refactoring the Domain Logic

      4:04
    • 200. Deployment

      1:21
    • 201. Preparing the App for Production

      2:28
    • 202. Getting Started with Heroku

      2:15
    • 203. Preparing the App for Heroku

      1:55
    • 204. Adding the Code to a Git Repository

      2:44
    • 205. Deploying to Heroku

      3:44
    • 206. Viewing Logs

      2:46
    • 207. Setting Environment Variables

      2:44
    • 208. MongoDB in the Cloud

      8:23
48 students are watching this class

About This Class

Learn to build fast, scalable and secure RESTful services with Node, Express and MongoDB, from setup to production

What Will You Learn?

  • Build the backend for your web and mobile apps
  • Use modern JavaScript features (ES6, ES7)

  • Implement CRUD operations

  • Handle and log errors, the right way
  • Write unit and integration tests
  • Practice test-driven development (TDD)
  • Store and retrieve complex data in MongoDB
  • Implement authentication and authorization
  • Deploy your Node apps to production
  • Apply the best practices for building fast, scalable and secure apps

Requirements

  • Basic familiarity with JavaScript

Description

What is Node.js?

Node.js, or Node, is a runtime environment for executing JavaScript code outside of a browser. It is ideal for building highly-scalable, data-intensive backend services (APIs) that power your client’s apps (web or mobile apps).

Why learn Node?

Node is great for prototyping and agile development as well as building super fast and highly scalable apps; Companies like Uber and PayPal use Node in production to build applications because it requires fewer people and less code. Plus, Node has the largest ecosystem of open-source library, so you don’t have to build everything from scratch.

A step-by-step, A to Z course

What you’ll get when you sign up for this course:

  • 15 hours of HD videos, complete with exercises and solutions
  • A real-world project: you’ll build the back-end for a video rental application, not a dummy to-do app!
  • No more wasted time on lengthy courses or out-of-date tutorials
  • Up-to-date and practical information and solutions (no fluff!)
  • The opportunity to learn at your own pace – lifetime access – so take your time if you prefer
  • Expert tips to become a Node rockstar
  • The best practices and common pitfalls to avoid
  • Watch on any device, online or offline – mobile friendly and downloadable lessons
  • Certificate of completion to present to your employer

You’ll learn to:

  • Confidently build RESTful services (APIs) using Node.js, Express.js, and MongoDB
  • Employ the best practices for Node.js
  • Avoid common mistakes

What we’ll cover:

  • Node module system
  • Node Package Manager (NPM)
  • Asynchronous JavaScript
  • Useful ES6+ features
  • Implementing CRUD operations
  • Storing complex data in MongoDB
  • Data Validation
  • Authentication and authorization
  • Handling and logging errors the right way
  • Unit and integration testing
  • Test-driven development (TDD)
  • Deployment

This course is for you if:

You’re a back-end developer who is used to working with frameworks like ASP.NET, Rails, Django, etc. You want to add Node.js to your toolbox.

You’re a front-end developer and want to transition to full-stack development.

You’ve tried other Node.js tutorials and found them to be too slow, out-of-date, and boring!

Having Node.js on your resume helps you find more jobs and make more money.