Installing LoopBack and Create an App - 01
Published in
3 min readJul 11, 2019
- LoopBack is highly extensible, open-source Node.js framework based on Express that enables you to quickly create APIs and microservices composed from the backend system such as database and SOAP or REST services.
- Here I am going to explain the method of installing LoopBack and Create App.
Step- 01
- First, you have to confirm that you were already installed node.
- For that, you have to run npm -v in your terminal.
- Here I have confirmed that. My machine has node (version 6.4.1)
Step- 02
- Then, type npm install -g loopback-cli in your terminal and run the command.
- Yeah, LoopBack is installing now.
Step- 03
- After finish installation of LoopBack, Create a new folder into the C drive as you wish. Here I have created as Js Projects.
Step- 04(Creating hello-loop App)
- Then, In your terminal go to the Js Project folder and type lb and run the command.
- After that, The generator guides you through creating your application. Enter and Select the values highlighted in green.
- After finish these all steps, you can check your Js Projects folder whether the application created or not.
- Yeah, here hello-loop application has created into the Js Projects folder.
Step- 05(Creating a person model into the hello-loop app)
- After creating the hello-loop app, in your terminal go to the hello-loop app and run the lb model command.
- After that, The generator guides you through creating your model. Enter the values highlighted in green. To accept the default, just press Enter.
- Then, go to the hello-loop application folder and check the directory hello-loop/common/model
- Yeah, person model has been successfully added into our hello-loop app.
Step- 06(Add some properties to our model)
- Here I am going to add the name and age as property.
- Adding name property.
- Adding age property.
- Press Enter when prompted for a property name to finish up and create the model.
Step- 07(Run the application)
- To run the application, run the node . command in your terminal.
- You will get like this,
- Load http://localhost:3000/explorer to see the built-in API Explorer.
- Yeah, here we got our hello-loop application. Congratulations.
Thank you for Reading.😊