1.0.15 • Published 3 years ago

loopback-mixin-slug v1.0.15

Weekly downloads
17
License
ISC
Repository
github
Last release
3 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

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago