fix: support websocket url configuration #19
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix: support websocket url configuration
I have added support for configuring the WebSocket URL to simplify swapping it during development. After considering two approaches — using an
.envfile or a configuration file — I chose to use the .env file for the following reasons:It suits our needs for storing simple key-value pairs.
The WebSocket URLs are runtime-specific and should not be committed to source control.
While configuration files are better suited for structured data (e.g., JSON) or scenarios where settings need to be committed, the
.envfile approach was a better fit for our use case.Additionally, I’ve specified in the
README.mdfor developers to create a .env.local file. This is useful because.env.localis ignored bynpm buildin most frameworks that use environment files (includingVite). It allows developers to define local overrides without affecting production builds or committing sensitive information.