Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #9739
Closed
Open
Issue created Oct 02, 2020 by Administrator@rootContributor

Allow setting the proxy through an environment variable

Created by: wozzo

Is your proposal related to a problem?

We have multiple tenants and the tenant is specified as part of the url that we proxy to e.g. The bindings we use locally are of the form tenant1.localhost, tenant2.localhost Currently we manually change the value of the proxy setting in the package.json file depending on which tenant we're testing against. This then means that that change often gets committed and leads to unnecessary conflicts as other devs have done the same.

Describe the solution you'd like

I suggest allowing the proxy setting to be controlled by either the package.json or an environment variable setting, with the environment variable winning if both are set. This would mean that a default value could be stored in the package.json, for the first time a dev environment is set up, but can be easily overridden without the possibilty for committing changes that lead to conflicts or affect other dev environments.

Describe alternatives you've considered

I tried configuring the proxy manually but we don't have a simple set of rules that can be applied to determine if the request should be proxied, so I was unsuccessful, and the existing react scripts one works perfectly for our needs apart from this one issue.

Additional context

I think that the proxy setting is similar to other advanced configuration options set using environment variables in that they are often specific to development environments and so should be configurable in the same way.

Assignee
Assign to
Time tracking