Closed abhinavkrin closed 1 year ago
Hey @abhinavkrin, do we have to add dotenv for this in react folder?
I want to work on this issue. Can you please assign it to me?
Hey, @tanu-chahal Thank you, I have assigned this issue to you. You can refer to https://storybook.js.org/docs/react/configure/environment-variables/ for working.
Hey @abhinavkrin, thanks for the resources & assigning the issue to me, I have a query do we need to change the host in the stories of the chat component only? Or do we need to do it everywhere in api, auth, and every directory wherever localhost:3000 is hardcoded?
@tanu-chahal A better option would be to replace every instance of hard coded host url.
Description
The RocketChat Host URL is currently hardcoded as
http://localhost:3000
in the React Storybook configuration. However, it is essential to provide flexibility and configurability by allowing users to set the host URL via environment variables. This change will make it easier for users to adapt the configuration to their specific needs.Proposed Solution
We should modify the React Storybook configuration to read the RocketChat Host URL from an environment variable. By default, if the environment variable is not set, it should fallback to
http://localhost:3000
. So that if developers want to use HTTP://localhost:5000 as host url, then the storybook could be started using:or by setting up a
.env
file (it should be added to gitignore).Steps to Implement
http://localhost:3000
.Expected Behavior
Users should be able to easily configure the RocketChat Host URL for React Storybook by setting an environment variable. When no environment variable is set, it should default to
http://localhost:3000
.