Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix usingProxy() on Windows #2562

Merged
merged 3 commits into from
Oct 18, 2023
Merged

Fix usingProxy() on Windows #2562

merged 3 commits into from
Oct 18, 2023

Conversation

ijlee2
Copy link
Contributor

@ijlee2 ijlee2 commented Oct 18, 2023

Description

As mentioned in #2558 (comment), on Windows, my team member @Ajanth wasn't able to run the desired server even after I updated ember-cli-mirage to v3.0.1 (see #2559).

We think the issue is related to config/environment.js#L14, due to process.env.PWD and the hardcoded /'s.

After replacing process.env.PWD with process.cwd() and / with path.join(), we checked that we can run the server on both Windows and Mac. On Mac, I saw the same value logged for (1), (2), and (3):

console.log('(1) ' + `${process.env.PWD}/server/proxies`);
console.log('(2) ' + path.join(process.env.PWD, 'server', 'proxies'));
console.log('(3) ' + path.join(process.cwd(), 'server', 'proxies'));

Note, a StackOverflow answer suggests that process.env.PWD and process.cwd() can have a different meaning (value) when the current directory is changed. I'm not sure if that difference would affect ember-cli-mirage.

@SergeAstapov SergeAstapov changed the title Patch #2559 for Windows Make usingProxy() work on Windows Oct 18, 2023
@SergeAstapov SergeAstapov changed the title Make usingProxy() work on Windows Fix usingProxy() on Windows Oct 18, 2023
@SergeAstapov SergeAstapov merged commit 872cec9 into miragejs:master Oct 18, 2023
@ijlee2 ijlee2 deleted the patch-2559-for-windows branch October 19, 2023 05:32
francois2metz pushed a commit to francois2metz/ember-cli-mirage that referenced this pull request Dec 19, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants