1.0.15 • Published 4 years ago

loopback-mixin-slug v1.0.15

Weekly downloads
17
License
ISC
Repository
github
Last release
4 years ago

loopback-mixin-slug

Creates slugs for documents and retrieve documents by slugs.

Install

npm i loopback-mixin-slug -s

In the mixins property to your server/model-config.json add ../node_modules/loopback-mixin-slug:

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

Usage

To use with your Models in the mixins attribute of your model config put Slug.

 {
  "name": "ModelName",
  "mixins": {
    "Slug": {
      "fields": [
        "title"
      ]
    }
  },
  "properties": {
    "title": {
      "type": "string"
    }
  }
}

License

The MIT License (MIT). Please see License File for more information.

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago