Video Thumbnail

CRUD API Tutorial – Node, Express, MongoDB | freeCodeCamp.org YouTube Video Summary

Haris Iftikhar from freeCodeCamp.org walks through building a CRUD API using Node.js, Express, and MongoDB. This tutorial is for beginners, and assumes no prior experience. The video goes over each line of code, how to install and setup node, and also setup insomnia as a way of testing APIs.

freeCodeCamp.org

93 min

over 1 year ago

Detailed Summary:

Learn to Create a CRUD API Using Node.js, Express and MongoDB

Learn to create a CRUD API using the basics in Node.js, Express, and MongoDB from freeCodeCamp.org. This is a course designed for beginners and assumes very little knowledge.

Setup Code

To start, the const app equals express is required, and from there, you should make sure the server is listening on port 3000. After the port is running, make sure to set up a route for the request and response. To create an API to connect a rest framework in MongoDB, you need to install Visual Studio Code and to download Node.js.

Download Visual Studio Code

The first step is to download Visual Studio Code and Node.js. After this, create a simple crud app folder and make sure to open it up in CMD. From there you can type in code and a dot to open it in the directory.

Initialize the NPM

From there you need to do npm init -y to initialize this directory, and from there you could use the control to add a backtick to specify a command. From there you can specify the first command, init hyphen Y. At this point the package JSON file would have been written over to the directory.

Adding the Framework

Add Express for the back end and make sure it is installed. Over here the version is 1.0.0 and make sure that you have NodeJS installed. Make sure that this is downloaded and the installation steps are done. You can also test this using CMD, and just type Node and type "node --version." and you can see whether you have node installed or not.

Building a Complete Restful Crud API from Scratch

Make sure to zoom in the video and open up the terminal and specify the command. The first you want to do to type in NPN init - Y, to initialize it, with some package JSON.