Currently, the API URL constant is hardcoded in the policyengine-app/src/api/call.js file. This limits flexibility when deploying across different environments (dev/production) and is prone to unintended bugs.
Proposal (Open for Discussion)
Opening this issue as a placeholder to come back to. There are a couple of possible directions we could take here:
Option 1: Use Environment Variables
- Move API URL (and other) constants to .env files
- Access them using process.env.* in the codebase
- Caveat : Requires rebuild of the frontend app whenever env values change, which can slow down testing across multiple environments
Option 2: Centralized Config File
- Create a single config file (e.g., src/config/env.js) where constants for different environments can be toggled manually or loaded based on a flag
Currently, the API URL constant is hardcoded in the
policyengine-app/src/api/call.jsfile. This limits flexibility when deploying across different environments (dev/production) and is prone to unintended bugs.Proposal (Open for Discussion)
Opening this issue as a placeholder to come back to. There are a couple of possible directions we could take here:
Option 1: Use Environment Variables
Option 2: Centralized Config File