Skip to content

Commit d31f13a

Browse files
committed
v1.11
2 parents dcd2edb + 0716bf0 commit d31f13a

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ module.exports = (argv) => {
115115

116116
#### Enabling proxy
117117

118-
The server contains a simple http proxy.
118+
The server contains a simple http proxy.
119119
The proxy must be configured in the config file.
120120
To enable this proxy:
121121

@@ -125,7 +125,7 @@ angular-http-server --config configs/angular-http-server.config.js --useProxy tr
125125

126126
#### configuring proxy
127127

128-
To configure the proxy add a proxy object to your config file.
128+
To configure the proxy add a proxy object to your config file.
129129
The proxy should be an array of configs with two required properties: a forward property which must be a string array listing url parts which should trigger the proxy, and a target property which should define the target to proxy to.
130130
The config can also contain an optional protocol option, when this is absent the server will default to https
131131

@@ -135,19 +135,18 @@ simple example:
135135
module.exports = {
136136
proxy: [
137137
{
138-
forward: ['api/example-api', 'api-proxy/example'],
139-
target: 'localhost:5000',
140-
protocol: 'http'
138+
forward: ["api/example-api", "api-proxy/example"],
139+
target: "localhost:5000",
140+
protocol: "http",
141141
},
142142
{
143-
forward: ['api/example-api-2', 'api-proxy-2/example'],
144-
target: 'localhost:6000',
145-
}
143+
forward: ["api/example-api-2", "api-proxy-2/example"],
144+
target: "localhost:6000",
145+
},
146146
],
147147
};
148148
```
149149

150-
151150
## Self-Signed HTTPS Use
152151

153152
#### Production
@@ -156,6 +155,7 @@ The `--https` or `--ssl` flags are intended for development and/or testing purpo
156155

157156
## Changelog
158157

158+
- 1.11.0 - adds proxy support (thanks AVierwind)
159159
- 1.10.0 - adds --rootPath (thanks Aakash)
160160
- 1.9.0 - adds --baseHref (thanks bertbaron)
161161
- 1.8.0 - rewrite of path resolution (thanks dpraul)

example/config/config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
module.exports = {
22
proxy: [
33
{
4-
forward: ["todos"],
5-
target: "jsonplaceholder.typicode.com/todos/1",
6-
protocol: "https",
4+
forward: ["resources-test"],
5+
target: "localhost:8001",
6+
protocol: "http",
77
},
88
],
99
};

lib/proxy.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ function proxyHandler(req, res, configs) {
3636
);
3737
if (proxyHit) {
3838
const protocol = config.protocol ? config.protocol : "https";
39-
console.log(config.protocol, protocol);
4039
console.log(
4140
`Proxying request ${req.method}, ${req.url} to ${protocol}://${config.target}`
4241
);

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-http-server",
3-
"version": "1.10.1",
3+
"version": "1.11.0",
44
"author": "Simon Hampton",
55
"license": "ISC",
66
"description": "Simple http server for developers of apps with client side routing",
@@ -39,7 +39,7 @@
3939
}
4040
],
4141
"engines": {
42-
"node": ">=8.0.0"
42+
"node": ">=10.0.0"
4343
},
4444
"preferGlobal": true,
4545
"bin": {

0 commit comments

Comments
 (0)