Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bqxu/egg-loopback
loopback plugin for egg . (http://loopback.io/ & http://eggjs.org/)
https://github.com/bqxu/egg-loopback
egg-plugin eggjs loopback strongloop
Last synced: 2 months ago
JSON representation
loopback plugin for egg . (http://loopback.io/ & http://eggjs.org/)
- Host: GitHub
- URL: https://github.com/bqxu/egg-loopback
- Owner: be666
- License: mit
- Created: 2017-10-29T05:55:40.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-18T18:09:42.000Z (about 7 years ago)
- Last Synced: 2024-05-21T03:13:26.139Z (8 months ago)
- Topics: egg-plugin, eggjs, loopback, strongloop
- Language: JavaScript
- Homepage:
- Size: 63.5 KB
- Stars: 3
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-egg - egg-loopback - Loopback plugin for egg (nosql for mysql,mongoo,redis,Oracle,PostgreSQL..) (Plugins)
README
# egg-loopback
[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][codecov-image]][codecov-url]
[![David deps][david-image]][david-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![npm download][download-image]][download-url][npm-image]: https://img.shields.io/npm/v/egg-loopback.svg?style=flat-square
[npm-url]: https://npmjs.org/package/egg-loopback
[travis-image]: https://img.shields.io/travis/eggjs/egg-loopback.svg?style=flat-square
[travis-url]: https://travis-ci.org/eggjs/egg-loopback
[codecov-image]: https://img.shields.io/codecov/c/github/eggjs/egg-loopback.svg?style=flat-square
[codecov-url]: https://codecov.io/github/eggjs/egg-loopback?branch=master
[david-image]: https://img.shields.io/david/eggjs/egg-loopback.svg?style=flat-square
[david-url]: https://david-dm.org/eggjs/egg-loopback
[snyk-image]: https://snyk.io/test/npm/egg-loopback/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/egg-loopback
[download-image]: https://img.shields.io/npm/dm/egg-loopback.svg?style=flat-square
[download-url]: https://npmjs.org/package/egg-loopback## Install
```bash
$ npm i egg-loopback --save
```## Usage
```js
// {app_root}/config/plugin.js
exports.loopback = {
enable: true,
package: 'egg-loopback',
};
```## Configuration
```js
// {app_root}/config/config.default.js
exports.loopback = {
app: true,
client: {
dir: path.join(appInfo.baseDir, 'app/loopback'),
}
};
```see [config/config.default.js](config/config.default.js) for more detail.
## Example
[loopback-test](https://github.com/bqxu/egg-loopback/test/fixtures/apps/loopback-test)
```js
// {app_root}/app/controller
module.exports = app => {class DemoController extends app.Controller {
* index() {const { Test } = this.app.loopback.models;
this.ctx.body = yield Test.find();
}* create() {
const { name } = this.ctx.query;
const { Test } = this.app.loopback.models;yield Test.create({ name });
this.ctx.body = yield Test.find();
}}
return DemoController;
};
```
## Questions & Suggestions
Please open an issue [here](https://github.com/eggjs/egg/issues).
## License
[MIT](LICENSE)