-
Notifications
You must be signed in to change notification settings - Fork 7
Set port details on npm run start
#118
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
base: master
Are you sure you want to change the base?
Set port details on npm run start
#118
Conversation
@Bijit-Mondal this requires changes to all the boilerplate code and the configs in the appInfo on the FE and BE for them. Unfortunately i can't merge this PR unless it's fully completed. |
@rishabhpoddar okay making changes on all boilerplate code. |
@rishabhpoddar please review this PR. |
hey @Bijit-Mondal thanks for this PR. Given the size of it though, im not sure when we will have the time to review it. |
port = int(os.environ.get('REACT_APP_API_PORT') or os.environ.get('VITE_API_PORT') or 3001) | ||
runserver.default_port = 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.
The runserver.default_port
expects a string value, but the port variable is being converted to an integer. This will cause a type mismatch. Consider using:
runserver.default_port = str(port)
Or directly assign the string value:
runserver.default_port = os.environ.get('REACT_APP_API_PORT') or os.environ.get('VITE_API_PORT') or '3001'
port = int(os.environ.get('REACT_APP_API_PORT') or os.environ.get('VITE_API_PORT') or 3001) | |
runserver.default_port = port | |
port = int(os.environ.get('REACT_APP_API_PORT') or os.environ.get('VITE_API_PORT') or 3001) | |
runserver.default_port = str(port) |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
Summary of change
We can define the ports that the
npm run start
command will use, default is 3001 for backend and 3000 for frontend.We can specify a custom port when running your application:
Related Issue-
#108
Checklist for important updates
PORT=8000 REACT_APP_API_PORT=8080 bun run start
VITE_APP_PORT=8082 VITE_API_PORT=8000 bun run start
NEXT_PUBLIC_PORT=5167 bun run dev -- --port="5167"
VITE_PORT=5167 bun run dev
VITE_PORT=9192 bun run dev
PUBLIC_PORT=5167 bun run dev