Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

impr: detect development mode based on config instead of window.location #4703

Conversation

fehmer
Copy link
Member

@fehmer fehmer commented Oct 4, 2023

Description

While working on my local dev I noticed the website is connecting to the real API when opening the local site using a non-local IP.

With this change we pick the backend url and the flag to detect development environment from the webpack config and make it available in constants/config

@Miodec please check if this is usefull and if it will work on production.

@monkeytypegeorge monkeytypegeorge added the frontend User interface or web stuff label Oct 4, 2023
@fehmer
Copy link
Member Author

fehmer commented Oct 4, 2023

The link to the backend configuration is still http://localhost:5005/configure. I can replace it with the proper backend url, but the configuration site seems to only work correctly on localhost.
If you want I can check the backend code to make the /configure url available when acessing over external IP. If this should remain as a security feature I'll leave it as is.

@monkeytypegeorge monkeytypegeorge added the backend Server stuff label Oct 5, 2023
@fehmer fehmer marked this pull request as ready for review October 5, 2023 09:28
frontend/src/ts/ape/index.ts Outdated Show resolved Hide resolved
backend/src/api/routes/index.ts Show resolved Hide resolved
frontend/webpack/config.base.js Outdated Show resolved Hide resolved
@Miodec Miodec added the waiting for update Pull requests or issues that require changes/comments before continuing label Oct 6, 2023
@monkeytypegeorge
Copy link
Collaborator

Continuous integration check(s) failed. Please review the failing check's logs and make the necessary changes. https://github.com/monkeytypegame/monkeytype/actions/runs/6431232587

@fehmer fehmer force-pushed the feature/improve-detection-of-development-environment branch from 7ff2023 to d9249b4 Compare October 6, 2023 11:59
@monkeytypegeorge monkeytypegeorge added the docs Related to Markdown files and documentation label Oct 6, 2023
@fehmer fehmer force-pushed the feature/improve-detection-of-development-environment branch from dc87c30 to d9522a1 Compare October 6, 2023 12:42
@fehmer fehmer requested a review from Miodec October 7, 2023 11:12
@Miodec Miodec merged commit 0f6884a into monkeytypegame:master Oct 9, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Server stuff docs Related to Markdown files and documentation frontend User interface or web stuff waiting for update Pull requests or issues that require changes/comments before continuing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants