https://github.com/helderberto/node-rsr
💫 Node.JS: HTTP resource based in sequelize.
https://github.com/helderberto/node-rsr
http node-rsr nodejs resource sequelize
Last synced: about 1 year ago
JSON representation
💫 Node.JS: HTTP resource based in sequelize.
- Host: GitHub
- URL: https://github.com/helderberto/node-rsr
- Owner: helderberto
- License: mit
- Created: 2018-04-29T20:07:30.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-02T16:46:21.000Z (almost 8 years ago)
- Last Synced: 2025-03-08T20:44:42.979Z (about 1 year ago)
- Topics: http, node-rsr, nodejs, resource, sequelize
- Language: JavaScript
- Homepage:
- Size: 33.2 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# 💫 RSR
This is simple Node HTTP resource.
[](https://opensource.org/licenses/MIT)
## Requirements
* [Node](https://nodejs.org/en/);
* [Sequelize](http://docs.sequelizejs.com/manual/installation/getting-started.html).
## Installation
You can get it on npm.
```
npm install node-rsr --save
```
Or if you`re not into package management, just [download a ZIP](https://github.com/helderburato/node-rsr/archive/master.zip) file.
## Usage
```
static save(data) {
return Rsr.save(Model, {
data: data,
error: 'Custom error message (optional)',
validate: 'Custom validate message (optional)'
});
}
static update(params, data) {
return Rsr.update(Model, {
params: params,
data: data,
error: 'Custom error message (optional)',
validate: 'Custom validate message (optional)'
});
}
static delete(params) {
return Rsr.delete(Model, {
params: params,
error: 'Custom error message (optional)',
validate: 'Custom validate message (optional)'
});
}
static findAll(params) {
return Rsr.findAll(Model, {
params: params,
error: 'Custom error message (optional)'
});
}
static findOne(params) {
return Rsr.findOne(Model, {
params: params,
error: 'Custom error message (optional)'
});
}
```
## Contributing
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
## Changelog
This project adheres to [Semantic Versioning](https://semver.org/).
Every release, along with the migration instructions, is documented on the Github [Releases](https://github.com/helderburato/node-rsr/releases) page.
## Author
[Helder Burato](https://twitter.com/helderburato)
## License
[MIT License](LICENSE) © Helder Burato