Skip to content

Commit 2fc9df1

Browse files
authored
fix: explicitly set port for hapi server (#1291)
1 parent 9da243a commit 2fc9df1

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

lib/stencil-start.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class StencilStart {
6565
const updatedStencilConfig = this.updateStencilConfig(
6666
initialStencilConfig,
6767
storeInfoFromAPI,
68+
browserSyncPort,
6869
);
6970
this._storeSettingsLocale = await this.getStoreSettingsLocale(
7071
cliOptions,
@@ -126,11 +127,12 @@ class StencilStart {
126127
}
127128
}
128129

129-
updateStencilConfig(stencilConfig, storeInfoFromAPI) {
130+
updateStencilConfig(stencilConfig, storeInfoFromAPI, browserSyncPort) {
130131
return {
131132
...stencilConfig,
132133
storeUrl: storeInfoFromAPI.sslUrl,
133134
normalStoreUrl: storeInfoFromAPI.baseUrl,
135+
port: browserSyncPort,
134136
};
135137
}
136138

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function buildManifest(srcManifest, options) {
1414
const parsedSecureUrl = new URL(options.dotStencilFile.storeUrl); // The url to a secure page (prompted as login page)
1515
const parsedNormalUrl = new URL(options.dotStencilFile.normalStoreUrl); // The host url of the homepage;
1616
const storeUrl = parsedSecureUrl.protocol + '//' + parsedSecureUrl.host;
17-
resManifest.server.port = options.dotStencilFile.port;
17+
resManifest.server.port = parseInt(options.dotStencilFile.port, 10) + 1;
1818
pluginsByName['./plugins/router/router.module.js'].storeUrl = storeUrl;
1919
pluginsByName['./plugins/router/router.module.js'].normalStoreUrl =
2020
parsedNormalUrl.protocol + '//' + parsedNormalUrl.host;

0 commit comments

Comments
 (0)