1.0.0 • Published 8 years ago

loopback-mixin-method-exposition v1.0.0

Weekly downloads
4
License
BSD
Repository
github
Last release
8 years ago

Method exposition

This module is designed for the Strongloop Loopback framework. It allows of any Model to validate the complexity of a field. It can help to define the methods exposed each by each.

Install

  npm install --save loopback-mixin-method-exposition

Model configuration

Add the mixins property to your server/model-config.json:

{
  "_meta": {
    "sources": [
      "loopback/common/models",
      "loopback/server/models",
      "../common/models",
      "./models"
    ],
    "mixins": [
      "loopback/common/mixins",
      "../common/mixins",
      "../node_modules/loopback-mixin-method-exposition"
    ]
  }
}

Configure

To use with your Models add the mixins attribute to the definition object of your model config.

    "MethodExposition": {
      "expose": [
        "create",
        "find",
        "deleteById"
      ]
    }

Debug

To display all the endpoints disabled by model, you can run your server with this env variable

DEBUG=loopback:mixin:method-exposition npm start