Skip to content

Quick Start

  1. Copy the controller:
cp EnergySyc_EMS_ES100Cx12S/laravel_dev_help/EmsBackendController.php.snippet /path/to/ems-frontend/app/Http/Controllers/EmsBackendController.php
  1. Merge the service configuration and routes from the snippets.

  2. Add this to Laravel .env:

EMS_BACKEND_URL=http://ems-backend:8080
EMS_BACKEND_TOKEN=the-same-value-as-EMS_SETTINGS_API_TOKEN
EMS_BACKEND_TIMEOUT=10
  1. Clear Laravel caches:
php artisan config:clear
php artisan route:clear
  1. Verify routes:
php artisan route:list --path=api/ems
  1. Verify container connectivity from ems-frontend:
curl -H "Authorization: Bearer ${EMS_BACKEND_TOKEN}" \
  http://ems-backend:8080/api/v1/ems/health
  1. Connect the frontend UI to /api/ems/settings and /api/ems/readings.

For complete details, read api_contract.md, frontend_usage.md, and deployment_and_testing.md in this folder.