@umijs/request-record
TypeScript icon, indicating that this package has built-in type declarations

1.1.4 • Public • Published

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

  1. 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'],
});
  1. start umi
$ umi record role=admin
  1. mock file output in ./mock/requestRecord.mock.js

Readme

Keywords

none

Package Sidebar

Install

npm i @umijs/request-record

Weekly Downloads

4,981

Version

1.1.4

License

none

Unpacked Size

49.8 kB

Total Files

24

Last publish

Collaborators

  • xusd320
  • yifankakaxi
  • xierenyuan
  • stormslowly
  • xiefengnian
  • sorrycc
  • chenshuai2144
  • kuitos
  • peachscript
  • xiaohuoni