Skip to content

Commit bb8eb99

Browse files
authored
Set correct port to listen to in Angular buildpack (#158)
* Set correct port to listen to * lint * update test * add comment
1 parent 3f9f0ae commit bb8eb99

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/@apphosting/adapter-angular/src/bin/build.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe("build commands", () => {
3737
".apphosting/bundle.yaml": `headers: []
3838
redirects: []
3939
rewrites: []
40-
runCommand: node .apphosting/dist/server/server.mjs
40+
runCommand: SSR_PORT=$PORT node .apphosting/dist/server/server.mjs
4141
neededDirs:
4242
- .apphosting
4343
staticAssets:

packages/@apphosting/adapter-angular/src/utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,10 @@ async function generateBundleYaml(
183183
headers: [],
184184
redirects: [],
185185
rewrites: [],
186-
runCommand: `node ${normalize(relative(cwd, outputPathOptions.serverFilePath))}`,
186+
// this fix is needed for Angular version 17.3.2
187+
runCommand: `SSR_PORT=$PORT node ${normalize(
188+
relative(cwd, outputPathOptions.serverFilePath),
189+
)}`,
187190
neededDirs: [normalize(relative(cwd, outputPathOptions.outputDirectory))],
188191
staticAssets: [normalize(relative(cwd, outputPathOptions.browserDirectory))],
189192
}),

0 commit comments

Comments
 (0)