-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Conversation
lucasbordeau
commented
Nov 7, 2024
- Added REACT_APP_PORT in front .env
- Use value if specified otherwise 3001 by default
There was a problem hiding this 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; |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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