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

Force internal port to 8080 #2403

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

jturner
Copy link

@jturner jturner commented Dec 9, 2024

Description

This is a proposed fix for #2398. This is similar to a fix that was made to the client setup. Another option would be to change like 120 to PORT=3000 but my guess is older version of flyctl used port 8080 and don't want to break those.

Select what type of change this PR introduces:

  1. Just code/docs improvement (no functional change).
  2. Bug fix (non-breaking change which fixes an issue).
  3. New feature (non-breaking change which adds functionality).
  4. Breaking change (fix or feature that would cause existing functionality to not work as expected).

Update Waspc ChangeLog and version if needed

If you did a bug fix, new feature, or breaking change, that affects waspc, make sure you satisfy the following:

  1. I updated ChangeLog.md with description of the change this PR introduces.
  2. I bumped waspc version in waspc.cabal to reflect changes I introduced, with regards to the version of the latest wasp release, if the bump was needed.

Update example apps if needed

If you did code changes and added a new feature or modified an existing feature, make sure you satisfy the following:

  1. I updated waspc/examples/todoApp as needed (updated modified feature or added new feature) and manually checked it works correctly.
  2. I updated waspc/headless-test/examples/todoApp and its e2e tests as needed (updated modified feature and its tests or added new feature and new tests for it).

Copy link
Contributor

@infomiho infomiho left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution!

Left some comments :)

'internal_port',
)} in the fly.toml.

This means your server app might not be accessible.
Copy link
Contributor

Choose a reason for hiding this comment

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

I got confused by this part, what are we trying to say here: if the internal_port option is not present in the Fly TOML file the server app might not work correctly because Fly won't know how to reach it?


Press any key to continue or Ctrl+C to cancel.`);
} else {
// the default fly.toml assumes port 8080 (or 3000, depending on flyctl version).
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like this comment is redundant - we are setting the value to something we want, the default is not really important to know for the reader.

Copy link
Contributor

Choose a reason for hiding this comment

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

In this file, here:

we are also setting the server env var to 8080 and we want these two to change at the same time. So, I'd extract the port information into a variable and use it in both places e.g. serverPort or similar.

@@ -85,6 +85,7 @@ async function setupServer(deploymentInfo: DeploymentInfo<SetupOptions>) {
await $`flyctl launch --no-deploy ${launchArgs}`;

const minMachinesOptionRegex = /min_machines_running = 0/g;
const internalPortOptionRegex = /internal_port = \d+/g;
Copy link
Contributor

Choose a reason for hiding this comment

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

We already defined this regex in the setupClient fn, and since it's the same thing, I'd extract this regex to the top and use it both setupServer and setupClient functions.

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