request2type
a tool for generating type of request params/payload/query, works in http-proxy-middleware.
Install
$ yarn add @alipay/request-record --dev
Usage
In Umi
- add handler in umi config file.
import { defineConfig } from 'umi';
export default defineConfig({
proxy: {
'/api': {
target: 'http://local.alipay.net:8090',
},
},
requestRecord: {
fromProxy: '/api',
},
plugins: ['@alipay/request-record/dist/cjs/umi-plugin'],
});
- start umi
$ umi record role=admin
- mock file output in
./mock/requestRecord.mock.js