grunt-connect-proxy-mock
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "grunt-connect-proxy-mock", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Grunt Dev Server 的 Mock 与 Proxy 中间件", | ||
"main": "index.js", | ||
"main": "tasks/index.js", | ||
"keywords": [ | ||
@@ -11,3 +11,5 @@ "grunt", | ||
"mock", | ||
"dev-server" | ||
"dev-server", | ||
"gruntplugin", | ||
"http" | ||
], | ||
@@ -14,0 +16,0 @@ "author": "stuart_zhang <stuartpage@qq.com>", |
@@ -12,5 +12,17 @@ # grunt-connect-proxy-mock | ||
在`grunt-contrib-connect`插件配置结点`connect`下的自定义指令配置子节点内(例如,指令为`livereload`的配置结点),添加三个新配置节点`webSocketMockRouteRules`,`webMockRouteRules`和`webProxyRouteRules`。 | ||
向`grunt`任务清单添加`configureProxyMock`任务,在`configureProxies`之后与`connect`之前。 | ||
```javascript | ||
grunt.registerTask('serve', function (target) { | ||
grunt.task.run([ | ||
'configureProxies:serve', | ||
'configureProxyMock:livereload', | ||
'connect:livereload' | ||
]); | ||
}); | ||
``` | ||
在`grunt-contrib-connect`插件配置结点`connect`下的自定义任务配置子节点内(例如,任务为`livereload`的配置结点),添加三个新配置节点`webSocketMockRouteRules`,`webMockRouteRules`和`webProxyRouteRules`。 | ||
```javascript | ||
{ | ||
@@ -51,3 +63,3 @@ connect: { | ||
//【可选】监听 HTTP 请求的 url 查询字符串参数 | ||
// - 若指令,必须全部出现在被拦截的请求体内 | ||
// - 若任务,必须全部出现在被拦截的请求体内 | ||
query, | ||
@@ -68,3 +80,3 @@ //【必填】真响应数据集的篡改函数 | ||
第二,在`connect`中相同的指令配置结点下,给`grunt-connect-proxy`插件添加配置结点`proxies` | ||
第二,在`connect`中相同的任务配置结点下,给`grunt-connect-proxy`插件添加配置结点`proxies` | ||
@@ -147,3 +159,3 @@ ```javascript | ||
//【可选】监听 HTTP 请求的 url 查询字符串参数 | ||
// - 若指令,必须全部出现在被拦截的请求体内 | ||
// - 若任务,必须全部出现在被拦截的请求体内 | ||
query, | ||
@@ -150,0 +162,0 @@ //【必填】真响应数据集的篡改函数 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42184
167
1