@adobe/helix-deploy 4.14.1 → 4.15.0
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 +7 -0
- package/package.json +2 -2
- package/src/DevelopmentServer.js +10 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [4.15.0](https://github.com/adobe/helix-deploy/compare/v4.14.1...v4.15.0) (2021-11-20)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* improve development server setup ([#338](https://github.com/adobe/helix-deploy/issues/338)) ([9d2b44a](https://github.com/adobe/helix-deploy/commit/9d2b44a6a8d14953fe351dd0b8362ebdfd4a9a6b))
|
|
7
|
+
|
|
1
8
|
## [4.14.1](https://github.com/adobe/helix-deploy/compare/v4.14.0...v4.14.1) (2021-11-15)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-deploy",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.15.0",
|
|
4
4
|
"description": "Library and Commandline Tools to build and deploy OpenWhisk Actions",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"eslint-plugin-header": "3.1.1",
|
|
84
84
|
"eslint-plugin-import": "2.25.3",
|
|
85
85
|
"ghooks": "2.0.4",
|
|
86
|
-
"lint-staged": "
|
|
86
|
+
"lint-staged": "12.0.2",
|
|
87
87
|
"mocha": "9.1.3",
|
|
88
88
|
"mocha-junit-reporter": "2.0.2",
|
|
89
89
|
"mocha-multi-reporters": "1.5.1",
|
package/src/DevelopmentServer.js
CHANGED
|
@@ -70,6 +70,7 @@ module.exports = class DevelopmentServer {
|
|
|
70
70
|
this._main = main;
|
|
71
71
|
this._cwd = process.cwd();
|
|
72
72
|
this._port = process.env.WEBSERVER_PORT || 3000;
|
|
73
|
+
this._xfh = 'helix-pages.anywhere.run';
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
withPort(value) {
|
|
@@ -77,6 +78,11 @@ module.exports = class DevelopmentServer {
|
|
|
77
78
|
return this;
|
|
78
79
|
}
|
|
79
80
|
|
|
81
|
+
withXFH(value) {
|
|
82
|
+
this._xfh = value;
|
|
83
|
+
return this;
|
|
84
|
+
}
|
|
85
|
+
|
|
80
86
|
get port() {
|
|
81
87
|
return this._port;
|
|
82
88
|
}
|
|
@@ -131,21 +137,21 @@ module.exports = class DevelopmentServer {
|
|
|
131
137
|
*/
|
|
132
138
|
async start() {
|
|
133
139
|
this.app = express();
|
|
134
|
-
this.app.use(rawBody());
|
|
135
|
-
this.app.use(addRequestHeader('x-forwarded-host', 'helix-pages.anywhere.run'));
|
|
136
|
-
this.app.all('*', this._handler);
|
|
137
140
|
await new Promise((resolve, reject) => {
|
|
138
141
|
try {
|
|
139
142
|
this.server = this.app.listen(this._port, () => {
|
|
140
143
|
this._port = this.server.address().port;
|
|
141
144
|
// eslint-disable-next-line no-console
|
|
142
|
-
console.log(`Started development server
|
|
145
|
+
console.log(`Started development server at http://localhost:${this._port}/`);
|
|
143
146
|
resolve();
|
|
144
147
|
});
|
|
145
148
|
} catch (e) {
|
|
146
149
|
reject(e);
|
|
147
150
|
}
|
|
148
151
|
});
|
|
152
|
+
this.app.use(rawBody());
|
|
153
|
+
this.app.use(addRequestHeader('x-forwarded-host', this._xfh.replace('{port}', this._port)));
|
|
154
|
+
this.app.all('*', this._handler);
|
|
149
155
|
}
|
|
150
156
|
|
|
151
157
|
/**
|