Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-connect-proxy-mock

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-connect-proxy-mock - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

tasks/index.js

8

package.json
{
"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 @@ //【必填】真响应数据集的篡改函数

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc