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 OSX 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 will 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 Mongo DB, search the library for install Mongo DB to find videos on the topic. NPM install in the exercises file directory and then install HTTPie from httpie.org. Note that HTTPie is a Python 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 presented with a single click download button for your operating system.
Windows users on Windows seven or eight 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, startup the installer. When it starts up it's going to instruct you to drag the Docker, the application, into your applications folder. Once that's done you can open up the application's folder to startup 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 Doctor, you can pull the container onto 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 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 port 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 colon 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 we can edit the files directly. Docker actually makes it possible to start up a 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 run NPM install in the exercise file directory and you'll be ready to go. Go to the Docker homepage at the address shown on the screen. Under the get Docker menu item, select windows. Select download from Docker store and you're going to want to get the community edition so click on get Docker. Wait for the installer to download, open it up, accept the license agreement and it'll install.
Click finish and double click on Docker for Windows to open it up. It doesn't take long for the Docker engine to start at which point you want to open a command prompt, change into your exercise files directory. And then you're going to run the Docker command to start up the Docker container.
The Docker run dash IT dash V and the path to your exercise files directory. Desktop exercise files because there's a space in this you're going to need to use those quotes. I'm wrapping it to opt on the directory dash P 8080 colon 8080.
Synedra hapi API. Because it wants to share the drive you may need to tell it to share. It'll take a little while for it to install the container on your system.
Once it's done loading, run NPM install to install the node modules. And you're 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