Skip to content

refactor: move hardcoded URLs to environment variables#12

Merged
silvioprog merged 1 commit intomainfrom
refactor/move-urls-to-env-vars
Jan 21, 2026
Merged

refactor: move hardcoded URLs to environment variables#12
silvioprog merged 1 commit intomainfrom
refactor/move-urls-to-env-vars

Conversation

@silvioprog
Copy link
Copy Markdown
Owner

Summary

Refactors hardcoded URLs in index.html to use environment variables for better maintainability and consistency.

Changes

  • Added cloudflareInsightsUrls configuration to env.config.ts
  • Updated index.html to use __AUDIO_URL__ and __CLOUDFLARE_INSIGHTS_URL__ placeholders
  • Enhanced vite-plugins/html.ts to replace URL placeholders with environment-specific values
  • HTML plugin now captures build mode to select correct environment configuration

Benefits

  • Centralizes URL configuration in env.config.ts
  • Makes it easier to change URLs per environment
  • Aligns audio URL usage with existing VITE_AUDIO_URL pattern
  • Improves maintainability by removing hardcoded values from HTML

Files Changed

  • env.config.ts - Added Cloudflare Insights URL configuration
  • index.html - Replaced hardcoded URLs with placeholders
  • vite-plugins/html.ts - Added URL placeholder replacement logic

@silvioprog silvioprog self-assigned this Jan 21, 2026
@silvioprog silvioprog added the enhancement New feature or request label Jan 21, 2026
@silvioprog silvioprog merged commit c2637d4 into main Jan 21, 2026
2 checks passed
@silvioprog silvioprog deleted the refactor/move-urls-to-env-vars branch January 21, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant