Fix: Replace hardcoded localhost with 127.0.0.1 to resolve IPv6 connection#35
Open
smrithipiedy wants to merge 1 commit into
Open
Fix: Replace hardcoded localhost with 127.0.0.1 to resolve IPv6 connection#35smrithipiedy wants to merge 1 commit into
smrithipiedy wants to merge 1 commit into
Conversation
|
@smrithipiedy is attempting to deploy a commit to the anglenobida003-8112's projects Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
Hi @Ashmita1206, this PR is good to go! Please do check this out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of this PR:
Replaces hardcoded
localhostreferences with explicit127.0.0.1IPv4 loopback addresses in database connection strings and CORS proxy configurations.Fixes #34
Reason for this fix:
In Node.js v17 and later, DNS resolution for
localhostdefaults to the IPv6 address (::1) first. Because the local MongoDB server binds to the IPv4 interface, this causes Mongoose to hang indefinitely on startup, which subsequently causes Vite proxy timeouts (HTTP 500 errors) for new developers setting up the project.By explicitly declaring
127.0.0.1, the server starts instantly and bypasses the IPv6 resolution bug, greatly improving the Developer Experience (DX) for anyone cloning this repo.