http-proxy-middleware
Advanced tools
Comparing version 1.0.0 to 1.0.1
# Changelog | ||
## [v1.0.1](https://github.com/chimurai/http-proxy-middleware/releases/tag/v1.0.1) | ||
- fix(typescript): fix proxyRes and router types ([#410](https://github.com/chimurai/http-proxy-middleware/issues/410)) ([dylang](https://github.com/dylang)) | ||
## [v1.0.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v1.0.0) | ||
- feat(createProxyMiddleware): explicit import http-proxy-middleware (BREAKING CHANGE)([#400](https://github.com/chimurai/http-proxy-middleware/issues/400#issuecomment-587162378)) | ||
- feat(createProxyMiddleware): explicit import http-proxy-middleware ([BREAKING CHANGE](https://github.com/chimurai/http-proxy-middleware/releases))([#400](https://github.com/chimurai/http-proxy-middleware/issues/400#issuecomment-587162378)) | ||
- feat(typescript): export http-proxy-middleware types ([#400](https://github.com/chimurai/http-proxy-middleware/issues/400)) | ||
@@ -7,0 +11,0 @@ - fix(typescript): ES6 target - TS1192 ([#400](https://github.com/chimurai/http-proxy-middleware/issues/400#issuecomment-587064349)) |
@@ -19,8 +19,8 @@ /// <reference types="node" /> | ||
router?: { | ||
[hostOrPath: string]: string; | ||
} | ((req: Request) => string) | ((req: Request) => Promise<string>); | ||
[hostOrPath: string]: httpProxy.ServerOptions['target']; | ||
} | ((req: Request) => httpProxy.ServerOptions['target']) | ((req: Request) => Promise<httpProxy.ServerOptions['target']>); | ||
logLevel?: 'debug' | 'info' | 'warn' | 'error' | 'silent'; | ||
logProvider?(provider: LogProvider): LogProvider; | ||
onError?(err: Error, req: Request, res: Response): void; | ||
onProxyRes?(proxyRes: http.ServerResponse, req: Request, res: Response): void; | ||
onProxyRes?(proxyRes: http.IncomingMessage, req: Request, res: Response): void; | ||
onProxyReq?(proxyReq: http.ClientRequest, req: Request, res: Response): void; | ||
@@ -27,0 +27,0 @@ onProxyReqWs?(proxyReq: http.ClientRequest, req: Request, socket: net.Socket, options: httpProxy.ServerOptions, head: any): void; |
{ | ||
"name": "http-proxy-middleware", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "The one-liner node.js proxy middleware for connect, express and browser-sync", | ||
@@ -18,7 +18,7 @@ "main": "dist/index.js", | ||
"pretest": "yarn build", | ||
"test": "jest --runInBand", | ||
"test": "jest", | ||
"precover": "yarn clean && yarn build", | ||
"cover": "jest --runInBand --coverage", | ||
"cover": "jest --coverage", | ||
"precoveralls": "yarn clean && yarn build", | ||
"coveralls": "jest --runInBand --coverage --coverageReporters=text-lcov | coveralls", | ||
"coveralls": "jest --coverage --coverageReporters=text-lcov | coveralls", | ||
"postcoveralls": "yarn clean", | ||
@@ -54,23 +54,27 @@ "prepare": "yarn clean && yarn build" | ||
"devDependencies": { | ||
"@commitlint/cli": "^8.0.0", | ||
"@commitlint/config-conventional": "^8.0.0", | ||
"@types/express": "^4.17.0", | ||
"@types/is-glob": "^4.0.0", | ||
"@types/jest": "^25.1.2", | ||
"@commitlint/cli": "^8.3.5", | ||
"@commitlint/config-conventional": "^8.3.4", | ||
"@types/express": "^4.17.2", | ||
"@types/is-glob": "^4.0.1", | ||
"@types/jest": "^25.1.3", | ||
"@types/lodash": "^4.14.149", | ||
"@types/micromatch": "^4.0.1", | ||
"@types/node": "^12.6.2", | ||
"@types/node": "^13.7.4", | ||
"@types/supertest": "^2.0.8", | ||
"browser-sync": "^2.26.7", | ||
"connect": "^3.6.6", | ||
"connect": "^3.7.0", | ||
"coveralls": "^3.0.5", | ||
"express": "^4.16.4", | ||
"husky": "^3.0.0", | ||
"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", | ||
"supertest": "^4.0.2", | ||
"ts-jest": "^25.2.0", | ||
"tslint": "^6.0.0", | ||
"tslint-config-prettier": "^1.18.0", | ||
"typescript": "^3.7.5", | ||
"ws": "^7.1.0" | ||
"typescript": "^3.8.2", | ||
"ws": "^7.2.1" | ||
}, | ||
@@ -89,3 +93,4 @@ "dependencies": { | ||
"hooks": { | ||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS" | ||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS", | ||
"pre-commit": "lint-staged" | ||
} | ||
@@ -92,0 +97,0 @@ }, |
@@ -231,3 +231,2 @@ # http-proxy-middleware | ||
} | ||
``` | ||
@@ -247,3 +246,3 @@ | ||
// Custom router function | ||
// Custom router function (string target) | ||
router: function(req) { | ||
@@ -253,2 +252,11 @@ return 'http://localhost:8004'; | ||
// Custom router function (target object) | ||
router: function(req) { | ||
return { | ||
protocol: 'https:', // The : is required | ||
host: 'localhost', | ||
port: 8004 | ||
}; | ||
} | ||
// Asynchronous router function which returns promise | ||
@@ -255,0 +263,0 @@ router: async function(req) { |
208005
25
544
25