Skip to content

Commit 4fc39c0

Browse files
bram-atmireclaude
authored andcommitted
Move DNS fix comment inline next to setDefaultResultOrder call
Address PR feedback: remove file header comment and place the explanatory comment directly next to the code it documents. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent bec50dd commit 4fc39c0

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/main.server.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
/**
2-
* Fix for Node.js 17+ where DNS resolution prefers IPv6 over IPv4.
3-
* This causes "ECONNREFUSED ::1:8080" errors in PM2 cluster mode when
4-
* the backend only listens on IPv4.
5-
* See: https://github.com/nodejs/node/issues/40537
6-
*/
71
import 'core-js/es/reflect';
82
import 'zone.js';
93
import 'reflect-metadata';
@@ -20,7 +14,10 @@ import { bootstrapApplication } from '@angular/platform-browser';
2014
import { AppComponent } from './app/app.component';
2115
import { serverAppConfig } from './modules/app/server-app.config';
2216

23-
// Apply DNS resolution order fix for Node.js 17+
17+
// Apply DNS resolution order fix for Node.js 17+ by preferring IPv4 over IPv6.
18+
// This fixes "ECONNREFUSED ::1:8080" errors in PM2 cluster mode when
19+
// the backend only listens on IPv4
20+
// See https://github.com/DSpace/dspace-angular/issues/4960
2421
setDefaultResultOrder('ipv4first');
2522

2623
const bootstrap = () => bootstrapApplication(AppComponent, serverAppConfig);

0 commit comments

Comments
 (0)