Skip to content

Conversation

harnish7576
Copy link
Collaborator

@harnish7576 harnish7576 commented Aug 14, 2025

Fixes #2493

Description

Added environment configuration template, centralized API URL in constants, updated apiCall with fallback, and aligned tests with new constants setup

Changes

  • Created .env.example file as a template for environment configuration
  • Created a constants.js file under src/api to pull the API URL through the process.env, if not it will fallback to the hardcoded URL mentioned.
  • Added a Makefile command to automatically copy .env.example to .env
  • Imported API URL from constants to use be used as a constant in call.js .
  • Modified the apiCall function to use API URL constant

Tests

  • Updated the call.test.js to use the API URL from constants

Copy link

vercel bot commented Aug 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
policyengine-app Ready Preview Comment Aug 14, 2025 6:24pm

@harnish7576 harnish7576 marked this pull request as ready for review August 14, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

Replace Hardcoded API URL Constant with Environment Variable
1 participant