qm-proxy
v1.0.0
Published
## Install
Downloads
4
Readme
qm-proxy
Install
npm install qm-proxy -g
qm-proxy
| Name | Type | Default | Description |
| ---- | -------- | --------- | ---------------------------------------------------------- |
| api | string
| release
| api proxy host or port or one of test/dev/staging/release |
| web | string
| test
| web proxy host or port or one of test/dev/staging/release |
| port | number
| 8005
| proxy server port |
| mock | string | | write mock data or mock path |
正式环境PMDJ+测试环境Web
qm-proxy -api release -web test
# or use abbr
qm-proxy -a release -w test
# or use host
qm-proxy -a https://qieman.com -w test
本地PMDJ+测试环境Web
qm-proxy -a 3000 -w test
# or
qm-proxy -a http://127.0.0.1:3000 -w test
# or
qm-proxy -a http://localhost:3000 -w test
qm-proxy-mock
use 使用/创建Mock用例
# use mock case
qm-proxy-mock use <case-name>
# example
qm-proxy-mock use opened-pension
get/post 获取mock数据所在路径
# use vim edit data
vim $(qm-proxy-mock get https://test.qieman.com/pmdj/v1/user)
vim $(qm-proxy-mock get /pmdj/v1/user)
vim $(qm-proxy-mock post https://test.qieman.com/pmdj/v1/user)
# use idea edit mock data
idea $(qm-proxy-mock post https://test.qieman.com/pmdj/v1/user)
clear 清除当前用例的所有mock数据
qm-proxy-mock clear