@sap-ux/backend-proxy-middleware 0.6.64 → 0.6.66
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/README.md +37 -11
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ Optional object that can be used to directly set options of the used `http-proxy
|
|
|
30
30
|
|
|
31
31
|
Executing `ui5 serve` in your project with the configuration below in the `ui5.yaml` file would forward any request starting with the `path` parameter to the provided backend `url`.
|
|
32
32
|
|
|
33
|
-
```
|
|
33
|
+
```yaml
|
|
34
34
|
- name: backend-proxy-middleware
|
|
35
35
|
afterMiddleware: compression
|
|
36
36
|
configuration:
|
|
@@ -44,7 +44,7 @@ Executing `ui5 serve` in your project with the configuration below in the `ui5.y
|
|
|
44
44
|
If working in SAP Business Application Studio and the backend is configured as destination then you can also provide the `destination` in the configuration.
|
|
45
45
|
If a destination needs to be read by a specific instance of a destination service then you need to provide the id of the service as optional property `destinationInstance`.
|
|
46
46
|
|
|
47
|
-
```
|
|
47
|
+
```yaml
|
|
48
48
|
- name: backend-proxy-middleware
|
|
49
49
|
afterMiddleware: compression
|
|
50
50
|
configuration:
|
|
@@ -57,7 +57,7 @@ If a destination needs to be read by a specific instance of a destination servic
|
|
|
57
57
|
|
|
58
58
|
If the backend destination is configured to use principal propagation, then in some cases the requests might fail. If this occurs then you will need to set the optional property `xfwd` to `true`. This will add the x-forwared headers to the proxy requests.
|
|
59
59
|
|
|
60
|
-
```
|
|
60
|
+
```yaml
|
|
61
61
|
- name: backend-proxy-middleware
|
|
62
62
|
afterMiddleware: compression
|
|
63
63
|
configuration:
|
|
@@ -71,7 +71,7 @@ If the backend destination is configured to use principal propagation, then in s
|
|
|
71
71
|
### [Connecting to the SAP Business Technology Platform](#connecting-to-the-sap-business-technology-platform)
|
|
72
72
|
If you want to connect to an ABAP Environment on SAP Business Technology Platform then you will need to set the optional property `scp` to `true`. For any other target, remove this property or set it to `false`.
|
|
73
73
|
|
|
74
|
-
```
|
|
74
|
+
```yaml
|
|
75
75
|
- name: backend-proxy-middleware
|
|
76
76
|
afterMiddleware: compression
|
|
77
77
|
configuration:
|
|
@@ -84,7 +84,7 @@ If you want to connect to an ABAP Environment on SAP Business Technology Platfor
|
|
|
84
84
|
### [Connecting to the SAP API Business Hub](#connecting-to-the-sap-api-business-hub)
|
|
85
85
|
If you want to connect to the SAP API Business Hub then you will need to set the optional property `apiHub` to `true`, and set the corresponding `path` and `url`, e.g.
|
|
86
86
|
|
|
87
|
-
```
|
|
87
|
+
```yaml
|
|
88
88
|
- name: backend-proxy-middleware
|
|
89
89
|
afterMiddleware: compression
|
|
90
90
|
configuration:
|
|
@@ -97,7 +97,7 @@ If you want to connect to the SAP API Business Hub then you will need to set the
|
|
|
97
97
|
### [Proxying WebSockets](#proxying-websockets)
|
|
98
98
|
If you want the proxy to handle also WebSockets, then you need to set the optional property `ws` to `true`, e.g.
|
|
99
99
|
|
|
100
|
-
```
|
|
100
|
+
```yaml
|
|
101
101
|
- name: backend-proxy-middleware
|
|
102
102
|
afterMiddleware: compression
|
|
103
103
|
configuration:
|
|
@@ -111,12 +111,12 @@ If you want the proxy to handle also WebSockets, then you need to set the option
|
|
|
111
111
|
### [Changing the path to which a request is proxied](#changing-the-path-to-which-a-request-is-proxied)
|
|
112
112
|
If you want to configure the proxy to send requests from a certain path `/services/odata` to your backend (local url or destination) with a specified entry path `/my/entry/path`. Then you need to do the following:
|
|
113
113
|
|
|
114
|
-
```
|
|
114
|
+
```yaml
|
|
115
115
|
- name: backend-proxy-middleware
|
|
116
116
|
afterMiddleware: compression
|
|
117
117
|
configuration:
|
|
118
118
|
backend:
|
|
119
|
-
|
|
119
|
+
path: /services/odata
|
|
120
120
|
pathReplace: /my/entry/path
|
|
121
121
|
url: https://my.backend.example:1234
|
|
122
122
|
destination: my_example_destination
|
|
@@ -125,17 +125,43 @@ If you want to configure the proxy to send requests from a certain path `/servic
|
|
|
125
125
|
### [Providing Proxy Configuration](#providing-proxy-configuration)
|
|
126
126
|
By default the `backend-proxy-middleware` will read the proxy configuration from the OS environment variables `HTTP_PROXY`, `HTTPS_PROXY` and `NO_PROXY` or from the Node.js environment variables `proxy`, `https-proxy` and `noproxy`. If those variables are not set, then you can also provide the proxy configuration in the `ui5.yaml` file.
|
|
127
127
|
|
|
128
|
-
```
|
|
128
|
+
```yaml
|
|
129
129
|
- name: backend-proxy-middleware
|
|
130
130
|
afterMiddleware: compression
|
|
131
131
|
configuration:
|
|
132
132
|
proxy: https://myproxy.example:8443
|
|
133
133
|
backend:
|
|
134
|
-
|
|
134
|
+
path: /sap
|
|
135
135
|
url: https://my.backend.example:1234
|
|
136
136
|
|
|
137
137
|
```
|
|
138
138
|
**Please note:** if you want to exclude any domains from the proxy then you will need to set the `noproxy` variable. E.g. if you want to exclude the `https://my.backend.example:1234` from the proxy you will need to set `noproxy` to `npm config set noproxy ".backend.example"`. Note the leading `.`, if you provide only `backend.example`, then it will not work.
|
|
139
|
+
|
|
140
|
+
### [Proxying Multiple Paths Backends](#proxying-multiple-paths-backends)
|
|
141
|
+
|
|
142
|
+
To connect to multiple backend or multiple paths of a backend, use multiple instances of the middleware.
|
|
143
|
+
|
|
144
|
+
```yaml
|
|
145
|
+
- name: backend-proxy-middleware
|
|
146
|
+
afterMiddleware: compression
|
|
147
|
+
configuration:
|
|
148
|
+
backend:
|
|
149
|
+
path: /my/path
|
|
150
|
+
url: https://my.backend.example:1234
|
|
151
|
+
- name: backend-proxy-middleware
|
|
152
|
+
afterMiddleware: compression
|
|
153
|
+
configuration:
|
|
154
|
+
backend:
|
|
155
|
+
path: /my/other/path
|
|
156
|
+
url: https://my.backend.example:1234
|
|
157
|
+
- name: backend-proxy-middleware
|
|
158
|
+
afterMiddleware: compression
|
|
159
|
+
configuration:
|
|
160
|
+
backend:
|
|
161
|
+
path: /my/path
|
|
162
|
+
url: https://other.backend.example:1234
|
|
163
|
+
```
|
|
164
|
+
|
|
139
165
|
## Programmatic Usage
|
|
140
166
|
Alternatively you can only use the underlying proxy function, e.g. for the case when you want to use the `backend-proxy-middleware` functionality in your `express` server.
|
|
141
167
|
|
|
@@ -150,4 +176,4 @@ const proxy = createProxy(backend, options);
|
|
|
150
176
|
* Backend Proxy Middleware
|
|
151
177
|
* Fiori tools
|
|
152
178
|
* Fiori elements
|
|
153
|
-
* SAP UI5
|
|
179
|
+
* SAP UI5
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Abackend-proxy-middleware"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.6.
|
|
12
|
+
"version": "0.6.66",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
"i18next": "20.3.2",
|
|
29
29
|
"prompts": "2.4.2",
|
|
30
30
|
"proxy-from-env": "1.1.0",
|
|
31
|
-
"@sap-ux/axios-extension": "1.4.
|
|
32
|
-
"@sap-ux/btp-utils": "0.11.
|
|
31
|
+
"@sap-ux/axios-extension": "1.4.2",
|
|
32
|
+
"@sap-ux/btp-utils": "0.11.8",
|
|
33
33
|
"@sap-ux/logger": "0.3.7",
|
|
34
34
|
"@sap-ux/store": "0.3.12"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@types/express": "4.17.
|
|
37
|
+
"@types/express": "4.17.17",
|
|
38
38
|
"@types/http-proxy": "^1.17.5",
|
|
39
39
|
"@types/prompts": "2.0.14",
|
|
40
40
|
"@types/proxy-from-env": "1.0.1",
|