Skip to content

Instantly share code, notes, and snippets.

@michaelerobertsjr
Last active March 9, 2017 23:09
Show Gist options
  • Save michaelerobertsjr/63dac6b850b6ae1a8553bcf15cd6364a to your computer and use it in GitHub Desktop.
Save michaelerobertsjr/63dac6b850b6ae1a8553bcf15cd6364a to your computer and use it in GitHub Desktop.
Getting started with loopback

Getting Started with Loopback

  • install the generator
$ npm install -g strongloop
  • Scaffold out an app
$ slc loopback

Models

  • Add a model
slc loopback:model
  • Remove remote Methods
{MODEL_NAME}.disableRemoteMethod("create", true);
  • Create Relationships
slc loopback:relation

DataSource

$ slc loopback:datasource
  • Add Connector
$ npm install loopback-connector-mongodb
  • Update models to use MongoDB (model-config.js)

Configuring

  • Base url for your API (config.json)

  • Change the JSON file to JS and add production or development to the file eg. config.development.js and then export an object.


Middleware

  • Serving Static
"files": {
  "loopback#static": {
    "params": "$!../client"
  }
}

Next steps

http://loopback.io/doc/en/lb3/Next-steps.html

http://loopback.io/doc/en/lb3/Angular-example-app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment