Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danwakeem/loopback-search-mixin
A more search friendly search endpoint for loopback
https://github.com/danwakeem/loopback-search-mixin
Last synced: about 6 hours ago
JSON representation
A more search friendly search endpoint for loopback
- Host: GitHub
- URL: https://github.com/danwakeem/loopback-search-mixin
- Owner: Danwakeem
- Created: 2019-05-28T21:37:31.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T17:44:11.000Z (almost 2 years ago)
- Last Synced: 2024-04-24T08:18:43.925Z (7 months ago)
- Language: JavaScript
- Size: 403 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Loopback Search Endpoint
[![Build Status](https://travis-ci.com/Danwakeem/loopback-search-mixin.svg?branch=master)](https://travis-ci.com/Danwakeem/loopback-search-mixin)
[![Coverage Status](https://coveralls.io/repos/github/Danwakeem/loopback-search-mixin/badge.svg?branch=master)](https://coveralls.io/github/Danwakeem/loopback-search-mixin?branch=master)This loopback middleware replaces the default `GET /` endpoint with something that is a little more search friendly.
## Useage
## Install
`npm i loopback-search-mixin --save`## Integrate with Loopback
Include the mixin in your `model-config.json` file```json
{
"mixins": [
"../node_modules/loopback-search-mixin"
]
}
```Then add the mix in to your `model.json` file
```json
"mixins": {
"Search": true
},
```## Options
The default behavior of this mixin will set a limit of 10 and offset of 0.
You can override these defaults through the mixin options
```json
"mixins": {
"Search": {
"offset": 100,
"limit": 20,
}
},
```