Install Loopback
In this section we will install loopback and create a new backend.
Objective:
Learn about fundamental elements of a persistent storage system.
Loopback Backend Setup
We are going to create our boilerplate (aka code that is included in many areas that don’t need much alternation. Aka template).
Step 1: Install Loopback
If you haven't already created the final-project folder already, do so:
mkdir final-project
Change directory to final-project folder:
cd final-project
Important Note Moving Forward:
We will be creating a front-end folder and a back-end folder inside of this new final-project folder.
We need to make sure that we are not creating a back-end folder inside of the front-end folder, rather we need to create a back-end folder inside of the final-project folder.
Additionally:
We will not be making new directory by running the following command:
$ mkdir <dir-name>
Instead after we make sure we are in the final-project folder and we run the following commands these folders will be created for us:
Creating front-end folder
$ ng new final-project-front
Creating a back-end folder
$ lb
Check node version before install and ensure it is up to date.
$ node -v
Install loopback
It will give us some warnings but it is okay. This step is installing the loopback cli similar to angular cli. It will allow us to create a new loopback project.
Step 2: Creating New Loopback Project
Inside
final-project
directory enter the following command in the terminal:
Make sure we are inside the final-project
folder before running the following command
$ lb
Name our application
We will be asked to name our application. By default the name of the application is the folder name in the ( Final-Project ).
We are going to useFinal-Project-BK
Hit Enter
Select version of loopback: We will select version 3.x
Select the type of loopback application we want: Loopback has default settings for different types of projects. We will be choosing: api-server. Press enter to select.
Now let the install finish for your new project. You will see the following:
A Successful install we will result in:
To start, type in the terminal from within the final-project-bk folder run the following terminal command.
$ node .
Result:
This means the server is running. It needs to be running in order for our app to work. Keep the loopback app running in the terminal.
Successfully installed Loopback and created a new project
Last updated