Skip to content

Commit 270995e

Browse files
reppnersBrocco
authored andcommitted
docs(@angular/cli): adds multiple entries how-to
If there is a need to define multiple entries or otherwise more complex configuration a js file can be used to configure the proxy. These changes document how to do so.
1 parent 8bcd436 commit 270995e

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

docs/documentation/stories/proxy.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,33 @@ and then we edit the `package.json` file's start script to be
2626
```
2727

2828
now run it with `npm start`
29+
30+
### Multiple entries
31+
32+
If you need to proxy multiple entries to the same target define the configuration in `proxy.conf.js` e.g.
33+
34+
```js
35+
const PROXY_CONFIG = [
36+
{
37+
context: [
38+
"/my",
39+
"/many",
40+
"/endpoints",
41+
"/i",
42+
"/need",
43+
"/to",
44+
"/proxy"
45+
],
46+
target: "http://localhost:3000",
47+
secure: false
48+
}
49+
]
50+
51+
module.exports = PROXY_CONFIG;
52+
```
53+
54+
and make sure to point to the right file
55+
56+
```json
57+
"start": "ng serve --proxy-config proxy.conf.js",
58+
```

0 commit comments

Comments
 (0)