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

Be able to specify front port #8382

Merged
merged 3 commits into from
Nov 7, 2024
Merged

Conversation

lucasbordeau
Copy link
Contributor

  • Added REACT_APP_PORT in front .env
  • Use value if specified otherwise 3001 by default

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR adds configuration flexibility by allowing users to specify a custom front-end server port through the REACT_APP_PORT environment variable.

  • Added port configuration in /packages/twenty-front/vite.config.ts with fallback to 3001
  • Missing port number validation for valid range (1-65535)
  • No error handling for invalid port number conversion
  • Environment variable example missing from /packages/twenty-front/.env.example
  • Port configuration logic could conflict with getDefaultUrl() in /packages/twenty-front/src/config/index.ts when determining server URL

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

} = env;

const port = isNonEmptyString(REACT_APP_PORT) ? parseInt(REACT_APP_PORT) : 3001;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: parseInt() could return NaN for invalid numbers. Add validation for port range (1-65535) and handle invalid input.

@@ -17,8 +18,11 @@ export default defineConfig(({ command, mode }) => {
VITE_BUILD_SOURCEMAP,
VITE_DISABLE_TYPESCRIPT_CHECKER,
VITE_DISABLE_ESLINT_CHECKER,
REACT_APP_PORT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update self-hosting-var + front .env-example

@charlesBochet charlesBochet merged commit 83f3963 into main Nov 7, 2024
13 of 14 checks passed
@charlesBochet charlesBochet deleted the feat/add-front-port-in-en branch November 7, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants