1.1.0 • Published 6 years ago

swagger-mock-fe v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

安装

npm install --save-dev swagger-mock-fe

用法

const swaggerMock = require('swagger-mock-fe');
new swaggerMock({
    host: '10.xxx.xxx.15',//此处是swagger文档服务ip
    projectName: 'test',
    mockPos: '../../',
    headers: {
        'host': '域名'
    }
});

参数

Attributesformadescribe
hoststringswagger文档地址ip,必填
hostnamestringswagger文档访问域名,如果此处传入任何值,host字段则不生效
pathstringswagger文档数据请求路径,在swagger文档页面可以找到
portintegerswagger文档地址端口号, 默认80
projectNamestring项目名,默认值swaggermock
mockPortstring本地mock服务启动后的端口,默认为3001
mockPosstringmock文档生成的相对位置,默认为./
headersobject一般用于host的配置

运行

node run.js

使用

http://127.0.0.1:3000/xxx/xxx/xxx.do
1.1.0

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago