Skip to content

Conversation

connellr023
Copy link
Contributor

No description provided.

wizgod and others added 20 commits May 27, 2025 17:57
Modified port mappings for `frontend` and `backend` services.
The `frontend` now maps host port `8081` to container port `80`,
and the `backend` maps host port `8082` to container port `8080`.
Added `depends_on` for `frontend` to ensure it starts after `backend`.
Both services have a restart policy of `unless-stopped`.
Added module, target, and include properties. Retained
moduleResolution with a trailing comma for consistency.
This change adds a reference to the Vite client types in the
`vite-env.d.ts` file, enabling TypeScript to recognize
Vite-specific types and features in the project.
Updated the `AppConfig` struct in `app_config.go` to include two new fields: `Host` and `Port`, both of type `string`. This enhancement allows for more flexible configuration of the application's host and port settings.
Updated the `EnvToml` struct to include nested `Dev` and `Prod` structs for environment-specific `Host` and `Port` settings. Enhanced the `ToAppConfig` method to select the appropriate host and port based on the application's production status. The `AppConfig` struct now reflects these dynamic values.
Explicitly set Go version to 1.23 for compatibility.
Add copying of .env.toml to the container for environment setup.
Updated comments for clarity on changes made.
Replaced hardcoded backend development port with a dynamic backend host that reads from an environment variable. Removed `backendDevPort` and introduced `backendHost`, defaulting to `http://localhost:8080`. Updated URLs in `endpointMapping` to utilize the new `backendHost` for improved environment configuration flexibility.

Refactor backend URL configuration

Replaced hardcoded backend development port with a dynamic backend host URL sourced from an environment variable. Removed `backendDevPort` and introduced `backendHost`, defaulting to `http://localhost:8080`. Updated `endpointMapping` to utilize the new `backendHost` for constructing API endpoint URLs, enhancing adaptability to different backend configurations.
- Updated the dependency injection to determine the base URL and port based on the environment (development or production).
- Modified the redirect URL to use the dynamically determined host and port.
- Adjusted the main function to listen on the correct port and display the public-facing host.
- Cleaned up the code for better readability and maintainability.
Modified the conditions for omitting the default port suffix in the `initDependencyInjection` function to include port `8080` in production, in addition to the existing checks for ports `443` and `80`.
Modified the Dockerfile to use the latest Go image when root access is available, allowing for version flexibility. Retained the option to use Go version 1.23 for consistency in rootless Docker environments. Updated comments to clarify the rationale behind the choice of Go version based on access level.
Updated the `EnvToml` struct to include a `Cors` field in both `Dev` and `Prod` environments.
The `ToAppConfig` method now captures CORS settings based on the `InProduction` flag and includes them in the returned `AppConfig` struct.
Updated the `AppConfig` struct in `app_config.go` to include a new `Cors` field, which is a slice of strings (`[]string`). This enhancement allows the application to specify Cross-Origin Resource Sharing (CORS) settings, improving its ability to handle requests from different origins.
Updated the CORS middleware to accept a dynamic list of allowed origins instead of a single origin based on the environment. This change improves flexibility by allowing multiple origins to be specified during configuration.
Replaced the use of i.AppConfig.InProduction with
i.AppConfig.Cors to better manage CORS settings based
on the application's configuration.
…pport unit testing

Also ran Prettier on constants.ts to address PR formatting request.
@connellr023 connellr023 changed the title Connell/fix unit tests wizgod Fix unit tests failing after wizgod's changes Jul 7, 2025
@connellr023 connellr023 changed the title Fix unit tests failing after wizgod's changes Update README and fix frontend unit tests failing after wizgod's changes Jul 12, 2025
AndreyDiDev
AndreyDiDev previously approved these changes Aug 2, 2025
@connellr023 connellr023 dismissed AndreyDiDev’s stale review August 2, 2025 21:54

The merge-base changed after approval.

@connellr023 connellr023 requested a review from AndreyDiDev August 2, 2025 23:59
AndreyDiDev
AndreyDiDev previously approved these changes Aug 14, 2025
@connellr023 connellr023 dismissed AndreyDiDev’s stale review August 14, 2025 00:34

The merge-base changed after approval.

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.

3 participants