koa2-nginx
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -29,5 +29,3 @@ const HttpProxy = require('http-proxy'); | ||
if (options.event && typeof options.event === 'object') { | ||
this.handle(proxyServer, options.event); | ||
} | ||
this.handle(proxyServer, options.event); | ||
@@ -34,0 +32,0 @@ proxyServer.web(ctx.req, ctx.res, options, e => { |
{ | ||
"name": "koa2-nginx", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "This is an http-proxy based egg proxy middleware that can be used after bodyparse", | ||
@@ -51,3 +51,6 @@ "main": "index.js", | ||
"moment": "^2.22.2" | ||
}, | ||
"engines": { | ||
"node": ">=8.0.0" | ||
} | ||
} |
@@ -58,6 +58,2 @@ # koa2-nginx | ||
- `rewrite` | ||
rewrites the url redirects.unrequired,Funtion, default `path.replace(context, '')` | ||
- `proxies` | ||
@@ -114,3 +110,3 @@ koa-ngnix important parameter,required,expect get array,Each of the internal objects is a proxy combination, and some of the internal parameters can override globally parameters of the same name. | ||
logs: false, | ||
rewrite: path => path.rewrite('api', 'rewriteApi'), | ||
rewrite: path => path.replace('api', 'rewriteApi'), | ||
proxyTimeout: 10000, | ||
@@ -117,0 +113,0 @@ }, |
@@ -23,3 +23,3 @@ const packageInfo = require('../package.json'); | ||
// handle event:proxyReq、proxyRes、error | ||
handle(proxyServer, event) { | ||
handle(proxyServer, event = {}) { | ||
const { handleReq, handleRes, handleError } = event; | ||
@@ -26,0 +26,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
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
51644
331
146