https://github.com/gaetansenn/dw-api
Wrap all requests into one place and map your data for your needs
https://github.com/gaetansenn/dw-api
Last synced: 6 months ago
JSON representation
Wrap all requests into one place and map your data for your needs
- Host: GitHub
- URL: https://github.com/gaetansenn/dw-api
- Owner: gaetansenn
- License: mit
- Created: 2020-12-14T15:42:15.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-05-18T12:36:15.000Z (over 3 years ago)
- Last Synced: 2025-02-14T09:51:05.787Z (8 months ago)
- Language: JavaScript
- Size: 83 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# dw-ui
Dewib api wrap all your request into one place and map your response for your needs.## Install
Add package `yarn add @dewib/dw-api`
## Usage
Add your main service into `./dewib/api` folder
```js
import UserService from './user/index'export default {
UserService
}
```Then your service should look like
```js
import { Model } from '@dewib/dw-api/utils'
/**
*
*
* @export
* @class UserService
* @extends {Model}
*/
export default class UserService extends Model {
/**
* Create user
* @param {*} user
* @returns {Promise<*>} User model
*/
store (user, params) {
return this.$http...
}
}
```