Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delay #17

Closed
MEEllis opened this issue Aug 23, 2018 · 1 comment
Closed

Delay #17

MEEllis opened this issue Aug 23, 2018 · 1 comment

Comments

@MEEllis
Copy link

MEEllis commented Aug 23, 2018

如何加入延时返回呢?类似于这种东西
rrj oipwbfsc8mu 2 l0 94

jaywcjlove added a commit that referenced this issue Aug 23, 2018
jaywcjlove added a commit that referenced this issue Aug 23, 2018
@jaywcjlove
Copy link
Owner

@MEEllis 给你提供了一个一模一样的延迟加载方法,请更新 [email protected]+

const delay = require('webpack-api-mocker/utils/delay');
const noProxy = process.env.NO_PROXY === 'true';

const proxy = {
  'GET /api/user': {
    id: 1,
    username: 'kenny',
    sex: 6
  },
  // ...
}
module.exports = (noProxy ? {} : delay(proxy, 1000));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants