Skip to content

Suggestions on adding 'mock' attributes #25

@caohaijiang

Description

@caohaijiang

I am sorry, my English is very poor, but still love you this project. I am in the help of Google translation, and strive to establish communication with you. I am currently using this project and intend to recommend more people to use it. Here are my suggestions:
Uploading image.png…

`
const { apiServer } = {
url: 'http://x.x.x.x/api',
mockUrl: 'http://x.x.x.x/api' // API services created using json-server
}
const API = createAPI(resources, middleware, API_URL, fetchOptions);
.....
const user ={
user: {
namespace: 'users/',
mock: true, // hope to add a 'mock' attribute here,
methods: {
get: ( ) => ({ path: '' }),
add: (data) => ({path:''},{options:{
method:'POST',
body:JSON.stringify(data),
}}),
}
}
}

export default user
`
readme:
mock = true: Connecting real API resources
mock = false: Connecting mock API resources

benefit:
This advantage is obvious, can help developers in the debugging process, more efficient

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions