Skip to content

Conversation

@Lexicoding-systems
Copy link
Owner

Summary

Implements environment-aware API configuration system to replace hardcoded API URLs in dashboard files, enabling proper deployment across different environments.

Changes Made

  • dashboard.html: Replaced hardcoded const API_BASE = 'http://localhost:8000'; with environment detection
  • governance_dashboard.html: Replaced hardcoded const API_BASE = ''; with environment detection

Implementation Details

Added environment-aware configuration that:

  • Detects development environment via hostname (localhost, 127.0.0.1) or window.LEXECON_ENV flag
  • Automatically uses http://localhost:8000 in development
  • Automatically uses window.location.origin + '/api' in production
  • Allows manual override via window.LEXECON_API_BASE for custom deployments

Benefits

  • ✅ No more hardcoded URLs requiring manual edits for deployment
  • ✅ Works seamlessly in dev, staging, and production environments
  • ✅ Flexible configuration for different deployment scenarios
  • ✅ Consistent pattern across all dashboard files (matches login.html from [SECURITY] Remove Development Credentials from login.html #17)

Testing

  • Verify dashboard loads correctly on localhost
  • Verify dashboard connects to correct API in development
  • Verify dashboard connects to correct API in production
  • Test manual override functionality with window.LEXECON_API_BASE

Closes #18

🤖 Generated with Claude Code

Replace hardcoded API_BASE URLs with environment-aware configuration:
- dashboard.html: Replace 'http://localhost:8000' with environment detection
- governance_dashboard.html: Replace '' with environment detection

Environment-aware configuration:
- Detects dev environment via hostname or window.LEXECON_ENV
- Uses localhost:8000 in development
- Uses window.location.origin + '/api' in production
- Allows manual override via window.LEXECON_API_BASE

Fixes #18

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@Lexicoding-systems Lexicoding-systems merged commit 654e081 into main Jan 10, 2026
4 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CONFIG] Implement Environment Configuration System for API URLs

2 participants