http-proxy-middleware 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,8 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [v1.0.1](https://github.com/chimurai/http-proxy-middleware/releases/tag/v1.0.1)
4
+
5
+ - fix(typescript): fix proxyRes and router types ([#410](https://github.com/chimurai/http-proxy-middleware/issues/410)) ([dylang](https://github.com/dylang))
6
+
3
7
  ## [v1.0.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v1.0.0)
4
8
 
5
- - feat(createProxyMiddleware): explicit import http-proxy-middleware (BREAKING CHANGE)([#400](https://github.com/chimurai/http-proxy-middleware/issues/400#issuecomment-587162378))
9
+ - 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))
6
10
  - feat(typescript): export http-proxy-middleware types ([#400](https://github.com/chimurai/http-proxy-middleware/issues/400))
7
11
  - fix(typescript): ES6 target - TS1192 ([#400](https://github.com/chimurai/http-proxy-middleware/issues/400#issuecomment-587064349))
8
12
 
package/README.md CHANGED
@@ -228,7 +228,6 @@ Providing an alternative way to decide which requests should be proxied; In case
228
228
  if (should_add_something) path += "something";
229
229
  return path;
230
230
  }
231
-
232
231
  ```
233
232
 
234
233
  - **option.router**: object/function, re-target `option.target` for specific requests.
@@ -243,11 +242,20 @@ Providing an alternative way to decide which requests should be proxied; In case
243
242
  '/rest' : 'http://localhost:8004' // path only
244
243
  }
245
244
 
246
- // Custom router function
245
+ // Custom router function (string target)
247
246
  router: function(req) {
248
247
  return 'http://localhost:8004';
249
248
  }
250
249
 
250
+ // Custom router function (target object)
251
+ router: function(req) {
252
+ return {
253
+ protocol: 'https:', // The : is required
254
+ host: 'localhost',
255
+ port: 8004
256
+ };
257
+ }
258
+
251
259
  // Asynchronous router function which returns promise
252
260
  router: async function(req) {
253
261
  const url = await doSomeIO();