space-lb2

messaging

space-node

This documentation is deprecated
Please see the new LoopBack documentation site.
Skip to end of metadata
Go to start of metadata

Redirecting to http://loopback.io/doc/en/lb2/Command-line-tools.html ...

Icon

Prerequisite: Install StrongLoop software following the instructions in Getting started with LoopBack.

Use the slc loopback command to create and scaffold applications.  Scaffolding simply means generating the basic code for your application.  You can then extend and modify the code as desired for your specific needs.

The slc loopback command provides an Application generator to create a new LoopBack application and a number of sub-generators to scaffold an application, as described in the following table. The commands are listed roughly in the order that you would use them.

 

Command

 

SeeDescription
slc loopbackApplication generatorCreate a new LoopBack application.
slc loopback:datasourceData source generatorAdd a new data source to a LoopBack application
slc loopback:modelModel generatorAdd a new model to a LoopBack application.
slc loopback:propertyProperty generatorAdd a new property to an existing model.
slc loopback:aclACL generatorAdd a new access control list (ACL) entry to the LoopBack application.
slc loopback:relation
Relation generatorAdd a new model relationship.
slc loopback:remote-methodRemote method generatorAdd a new remote method.
slc loopback:middleware
Middleware generatorAdd a new middleware configuration.
slc loopback:boot-scriptBoot script generatorAdd a new boot scripts.
slc loopback:export-api-defAPI definition generatorExport Swagger API definition.
slc loopback:swaggerSwagger generatorGenerates a fully-functional application that provides the APIs conforming to the Swagger 2.0 specification.
Icon

The slc command has many additional sub-commands not specific to LoopBack for building, deploying, and managing Node applications. See Operating Node applications for more information and Command-line reference for the command reference.

Under the hood, slc loopback uses Yeoman. If you are already using Yeoman and are comfortable with it, you can install the LoopBack generator directly with

npm install -g generator-loopback.

Then everywhere the documentation says to use slc loopback just use yo loopback instead. For example, to create a new model, use yo loopback:model.