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

fix(node): use consistent default port #16491

Merged
merged 1 commit into from
Apr 25, 2023

Conversation

philipjfulcher
Copy link
Collaborator

Current Behavior

The Node application generator has two different default ports: 3000 in the schema.json and 3333 in the generator itself. This results in a failing e2e test after generation.

Expected Behavior

The default port is consistent.

@vercel
Copy link

vercel bot commented Apr 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Apr 24, 2023 2:41am

@nartc
Copy link
Contributor

nartc commented Apr 24, 2023

Some frontend generators use port 3333 to setup proxy conf if consumers pass in --backendProject. Can we change the default in schema.json to 3333 instead?

@philipjfulcher
Copy link
Collaborator Author

philipjfulcher commented Apr 24, 2023

Some frontend generators use port 3333 to setup proxy conf if consumers pass in --backendProject. Can we change the default in schema.json to 3333 instead?

If we do that, we would also need to change the default port for the e2e. I see one place that backendProject is used: https://github.com/nrwl/nx/blob/master/packages/angular/src/generators/application/lib/add-proxy-config.ts

3333 is hard-coded as the port. I don't think that's safe, given that a backend project could be running off any port, even if we change the default. It also assumes the url will be the same name as the backend project. From my very limited perspective, it would be a better idea to change those frontend generators to accept something like a proxyUrl and a proxyTarget config where the user could provide the values instead of trying to make assumptions.

I think the problems with that generator exist no matter if we change the defaults here. I could change the default port in those frontend generators to also be 3000 to get everything lined up and at least working out of the box.

@github-actions
Copy link

github-actions bot commented May 1, 2023

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants