Learn how to setup Node.js locally or by using Docker.
Docker provides all needed languages, libraries and tools to follow along with the course. Native clients are available for both OS X and Windows. If you prefer a local installation, it will give you the ability to work with your existing language preferences, libraries and native development environment. If you do want to install locally, you'll need to follow these steps on your system. First, install Node.js and npm. Install and start a mongo database.
If you're having issues installing MongoDB, search the library for install MongoDB to find videos on the topic. Npm install in the exercise file directory and then install HTTPie from httpie.org. Note that HTTPie is a Pythton utility and requires that you have both Python and pip installed. To get started with Docker, visit the site at docker.com. Click, Get Started, and you'll be presented with a single-click download button for your operating system.
Windows users on Windows 7 or 8 will need to install the Docker toolkit linked from the Windows download page. Go through the installation process and you'll be ready to go. After the download has completed, start up the installer. When it starts up, it's going to instruct you to drag Docker, the application, into your Applications folder. Once that's done, you can open up the applications folder to start up Docker. The first time Docker runs, it's going to do some setup on your environment and it's going to need to have administrator access in order to do this.
After it's done setting up the configurations on your system, it's going to show you some helpful tips about how to use Docker and it's up and ready to go. Once you've installed Docker, you can pull the container on to your local system. Open a terminal or command prompt. Change into the directory where you stored the exercise files. From here, you can run the container. We're going to be setting the container up slightly differently than you may have done previously with Docker, as we will be mapping the current directory into the Docker container so that you can edit those files using Visual Studio Code rather than having to use a command line editor such as vi or nano.
So, in order to run this command, we're going to say docker run. The first part of this command tells Docker that what you want to do is pull the current version of the container and run it on your system. The next thing we're going to do is we're going to go ahead and map that directory to the local file. So, what you're saying is, the directory that I'm currently in, pwd, map that to opt in the directory on the Docker container.
And then, we're going to map for 8080 on the Docker container to our local host. What that's going to do is it's going to make it possible for me to go to local host:8080 and actually see the web server that's being run there. And then, we need to tell it that we want it to be an interactive terminal so that we can edit the files directly. Docker actually makes it possible to start up container without connecting to it, but that's not what we want to do here. And then, you put the name of the container that you want to run.
This command can take some time to complete. And then we run npm install in the exercise file directory and you'll be ready to go.
- Setting up the development environment
- Consuming an API using HTTPie
- Inspecting Mongo data
- Updating the server for MongoDB read functionality
- Setting up application endpoints
- Implementing user endpoints, progress endpoints, and promises