http-proxy-middleware
Advanced tools
Comparing version 1.0.3 to 1.0.4
# Changelog | ||
## [v1.0.4](https://github.com/chimurai/http-proxy-middleware/releases/tag/v1.0.4) | ||
- chore(deps): http-proxy 1.18.1 ([#442](https://github.com/chimurai/http-proxy-middleware/pull/442)) | ||
## [v1.0.3](https://github.com/chimurai/http-proxy-middleware/releases/tag/v1.0.3) | ||
@@ -4,0 +8,0 @@ |
@@ -12,3 +12,3 @@ "use strict"; | ||
context: undefined, | ||
options: {} | ||
options: {}, | ||
}; | ||
@@ -15,0 +15,0 @@ // app.use('/api', proxy({target:'http://localhost:9000'})); |
@@ -43,3 +43,3 @@ "use strict"; | ||
}); | ||
this.catchUpgradeRequest = server => { | ||
this.catchUpgradeRequest = (server) => { | ||
if (!this.wsInternalSubscribed) { | ||
@@ -46,0 +46,0 @@ server.on('upgrade', this.handleUpgrade); |
@@ -12,3 +12,3 @@ "use strict"; | ||
warn: console.warn, | ||
error: console.error | ||
error: console.error, | ||
}; | ||
@@ -15,0 +15,0 @@ // log level 'weight' |
@@ -28,3 +28,3 @@ "use strict"; | ||
let result = path; | ||
_.forEach(rulesCache, rule => { | ||
_.forEach(rulesCache, (rule) => { | ||
if (rule.regex.test(path)) { | ||
@@ -62,3 +62,3 @@ result = result.replace(rule.regex, rule.value); | ||
regex: new RegExp(key), | ||
value: rewriteConfig[key] | ||
value: rewriteConfig[key], | ||
}); | ||
@@ -65,0 +65,0 @@ logger.info('[HPM] Proxy rewrite rule created: "%s" ~> "%s"', key, rewriteConfig[key]); |
{ | ||
"name": "http-proxy-middleware", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "The one-liner node.js proxy middleware for connect, express and browser-sync", | ||
@@ -19,7 +19,3 @@ "main": "dist/index.js", | ||
"test": "jest", | ||
"precover": "yarn clean && yarn build", | ||
"cover": "jest --coverage", | ||
"precoveralls": "yarn clean && yarn build", | ||
"coveralls": "jest --coverage --coverageReporters=text-lcov | coveralls", | ||
"postcoveralls": "yarn clean", | ||
"coverage": "jest --coverage --coverageReporters=lcov", | ||
"prepare": "yarn clean && yarn build && rm dist/tsconfig.tsbuildinfo" | ||
@@ -56,29 +52,28 @@ }, | ||
"@commitlint/config-conventional": "^8.3.4", | ||
"@types/express": "^4.17.2", | ||
"@types/express": "^4.17.3", | ||
"@types/is-glob": "^4.0.1", | ||
"@types/jest": "^25.1.3", | ||
"@types/lodash": "^4.14.149", | ||
"@types/jest": "^25.2.1", | ||
"@types/lodash": "^4.14.150", | ||
"@types/micromatch": "^4.0.1", | ||
"@types/node": "^13.7.4", | ||
"@types/supertest": "^2.0.8", | ||
"@types/node": "^13.13.5", | ||
"@types/supertest": "^2.0.9", | ||
"browser-sync": "^2.26.7", | ||
"connect": "^3.7.0", | ||
"coveralls": "^3.0.5", | ||
"express": "^4.17.1", | ||
"husky": "^4.2.3", | ||
"jest": "^25.1.0", | ||
"lint-staged": "^10.0.7", | ||
"mockttp": "^0.19.3", | ||
"open": "^7.0.2", | ||
"prettier": "^1.19.1", | ||
"husky": "^4.2.5", | ||
"jest": "^26.0.1", | ||
"lint-staged": "^10.2.2", | ||
"mockttp": "^0.20.1", | ||
"open": "^7.0.3", | ||
"prettier": "^2.0.5", | ||
"supertest": "^4.0.2", | ||
"ts-jest": "^25.2.0", | ||
"tslint": "^6.0.0", | ||
"ts-jest": "^25.5.0", | ||
"tslint": "^6.1.2", | ||
"tslint-config-prettier": "^1.18.0", | ||
"typescript": "^3.8.2", | ||
"ws": "^7.2.1" | ||
"typescript": "^3.8.3", | ||
"ws": "^7.2.5" | ||
}, | ||
"dependencies": { | ||
"@types/http-proxy": "^1.17.3", | ||
"http-proxy": "^1.18.0", | ||
"@types/http-proxy": "^1.17.4", | ||
"http-proxy": "^1.18.1", | ||
"is-glob": "^4.0.1", | ||
@@ -85,0 +80,0 @@ "lodash": "^4.17.15", |
@@ -135,3 +135,3 @@ # http-proxy-middleware | ||
'^/api/old-path': '/api/new-path', // rewrite path | ||
'^/api/remove/path': '/path' // remove base path | ||
'^/api/remove/path': '/path', // remove base path | ||
}, | ||
@@ -141,4 +141,4 @@ router: { | ||
// override target 'http://www.example.org' to 'http://localhost:8000' | ||
'dev.localhost:3000': 'http://localhost:8000' | ||
} | ||
'dev.localhost:3000': 'http://localhost:8000', | ||
}, | ||
}; | ||
@@ -199,3 +199,3 @@ | ||
*/ | ||
const filter = function(pathname, req) { | ||
const filter = function (pathname, req) { | ||
return pathname.match('^/api') && req.method === 'GET'; | ||
@@ -205,3 +205,3 @@ }; | ||
const apiProxy = createProxyMiddleware(filter, { | ||
target: 'http://www.example.org' | ||
target: 'http://www.example.org', | ||
}); | ||
@@ -292,3 +292,3 @@ ``` | ||
warn: logger.warn, | ||
error: logger.error | ||
error: logger.error, | ||
}; | ||
@@ -308,3 +308,3 @@ return myCustomProvider; | ||
res.writeHead(500, { | ||
'Content-Type': 'text/plain' | ||
'Content-Type': 'text/plain', | ||
}); | ||
@@ -426,3 +426,3 @@ res.end('Something went wrong. And we are reporting a custom error message.'); | ||
target: 'http://localhost:4003/', | ||
buffer: streamify(req.rawBody) | ||
buffer: streamify(req.rawBody), | ||
}, | ||
@@ -429,0 +429,0 @@ next |
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
24
61170
Updated@types/http-proxy@^1.17.4
Updatedhttp-proxy@^1.18.1