Docs: #cleanup and style fixes
This commit is contained in:
parent
e0132c2cae
commit
85cd2823da
23
README.md
23
README.md
@ -11,6 +11,9 @@ npm install -S hapi-sequelize-crud
|
||||
|
||||
##Configure
|
||||
|
||||
Please note that you should register `hapi-sequelize-crud` after defining your
|
||||
associations.
|
||||
|
||||
```javascript
|
||||
// First, register hapi-sequelize
|
||||
await register({
|
||||
@ -35,6 +38,7 @@ await register({
|
||||
// `models` property. If you omit this property, all models will have
|
||||
// models defined for them. e.g.
|
||||
models: ['cat', 'dog'] // only the cat and dog models will have routes created
|
||||
|
||||
// or
|
||||
models: [
|
||||
// possible methods: list, get, scope, create, destroy, destroyAll, destroyScope, update
|
||||
@ -54,18 +58,17 @@ await register({
|
||||
```
|
||||
|
||||
### Methods
|
||||
* list: get all rows in a table
|
||||
* get: get a single row
|
||||
* scope: reference a [sequelize scope](http://docs.sequelizejs.com/en/latest/api/model/#scopeoptions-model)
|
||||
* create: create a new row
|
||||
* destroy: delete a row
|
||||
* destroyAll: delete all models in the table
|
||||
* destroyScope: use a [sequelize scope](http://docs.sequelizejs.com/en/latest/api/model/#scopeoptions-model) to find rows, then delete them
|
||||
* update: update a row
|
||||
* **list**: get all rows in a table
|
||||
* **get**: get a single row
|
||||
* **scope**: reference a [sequelize scope](http://docs.sequelizejs.com/en/latest/api/model/#scopeoptions-model)
|
||||
* **create**: create a new row
|
||||
* **destroy**: delete a row
|
||||
* **destroyAll**: delete all models in the table
|
||||
* **destroyScope**: use a [sequelize scope](http://docs.sequelizejs.com/en/latest/api/model/#scopeoptions-model) to find rows, then delete them
|
||||
* **update**: update a row
|
||||
|
||||
|
||||
|
||||
Please note that you should register `hapi-sequelize-crud` after defining your
|
||||
associations.
|
||||
|
||||
##What do I get
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user