Skip to content

Commit

Permalink
fix(@schematics/angular): rename SSR port env variable
Browse files Browse the repository at this point in the history
Rename the SSR port env variable to SSR_PORT.
It could help to resolve this firebase issue: firebase/firebase-tools#6651 (comment), cause PORT is reserved environment variable: https://firebase.google.com/docs/functions/config-env?gen=2nd#reserved-names.
  • Loading branch information
9kubczas4 authored and clydin committed Mar 22, 2024
1 parent 1ab035a commit 950a445
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function startNodeServer(
): Observable<void> {
const outputPath = serverOutput.outputPath as string;
const path = join(outputPath, 'main.js');
const env = { ...process.env, PORT: '' + port };
const env = { ...process.env, SSR_PORT: '' + port, PORT: '' + port };

const args = ['--enable-source-maps', `"${path}"`];
if (inspectMode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('Serve SSR Builder', () => {
return server;
}
app().listen(process.env['PORT']);
app().listen(process.env['SSR_PORT']);
export * from './app/app.module.server';
`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('Serve SSR Builder', () => {
return server;
}
app().listen(process.env['PORT']);
app().listen(process.env['SSR_PORT']);
export * from './app/app.module.server';
`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('Serve SSR Builder', () => {
return server;
}
app().listen(process.env['PORT']);
app().listen(process.env['SSR_PORT']);
export * from './app/app.module.server';
`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export function app(): express.Express {
}
function run(): void {
const port = process.env['PORT'] || 4000;
const port = process.env['SSR_PORT'] || 4000;
// Start up the Node server
const server = app();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export function app(): express.Express {
}
function run() {
const port = process.env.PORT || 4000;
const port = process.env.SSR_PORT || 4000;
// Start up the Node server
const server = app();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function app(): express.Express {
}

function run(): void {
const port = process.env['PORT'] || 4000;
const port = process.env['SSR_PORT'] || 4000;

// Start up the Node server
const server = app();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function app(): express.Express {
}

function run(): void {
const port = process.env['PORT'] || 4000;
const port = process.env['SSR_PORT'] || 4000;

// Start up the Node server
const server = app();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function app(): express.Express {
}

function run(): void {
const port = process.env['PORT'] || 4000;
const port = process.env['SSR_PORT'] || 4000;

// Start up the Node server
const server = app();
Expand Down

0 comments on commit 950a445

Please sign in to comment.