You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given the object we used to initialize the `HttpProxyRules` instance above, here are some [**examples**](test/index.tests.js#L38) of how sample url paths would be translated.
51
+
50
52
## Options
51
53
52
54
You can initialize a new `http-proxy-rules` instance with the following options:
@@ -57,7 +59,7 @@ You can initialize a new `http-proxy-rules` instance with the following options:
57
59
default:''// (optional) if no rules matched, translate url path to specified default
58
60
}
59
61
```
60
-
The rules object contains a set of key-value pairs mapping a regex-supported url path to a target route. The target route must include the protocol (e.g., http) and the FQDN. See the [tests](test/index.tests.js) for examples of how incoming route url paths may be translated with the use of this module.
62
+
The rules object contains a set of key-value pairs mapping a regex-supported url path to a target route. The module only tries to match the visited url path, and not the entire url, with a specified rule. The target route must include the protocol (e.g., http) and the FQDN. See the [tests](test/index.tests.js) for examples of how incoming route url paths may be translated with the use of this module.
61
63
62
64
## Other Notes
63
65
*`(?:\\W|$)` is appended to the end of the regex-supported url path, so that if there is a key like `.*/test` in the rules, the module matches paths `/test`, `/test/`, `/test?` but not `/testing`.
0 commit comments