To use loopback with angular, we generate a service file that is registered with angular. To generate this file, we use a tool that comes with the strongloop package (npm install -g strongloop). This command will require you to provide it with the URL for the api. For development, this will be http//localhost:3000/api. You will also need the path to the server.js file in the server repository.

 

Generation Command
SETUP:
lb-ng -u http://localhost:3000/api path/to/server.js output/file/location/lb-services.js
 
EXAMPLE EXECUTING FROM rocreadar_server/core/:
lb-ng -u http://localhost:3000/api server/server.js ../../rocreadar_portal/app/scripts/lb-services.js

 

In the deployment script, the host will be set automatically to the external ip address of the server it is being executed from.