diff --git a/README.md b/README.md index 84c0f597..09f43e08 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ npm run dev The web app starts at `http://localhost:3000`. -### 5. Run the desktop client (optional) +### 5. Run the desktop client ```sh cd desktop @@ -87,10 +87,61 @@ cp connectionpetstore.properties.example connectionpetstore.properties mvn javafx:run ``` -### 6. Run the Android app (optional) +### 6. Run the Android app Open `android/` in Android Studio and run on an emulator or device. +## Switching Between Azure and Local Backend + +Each client reads the backend URL from a config file. To point a client at the +hosted Azure backend versus a local one, flip the commented lines. + +### Web + +Edit `web/.env.local`: + +``` +# Local +BACKEND_URL=http://localhost:8080 +#BACKEND_URL=https://petshop-backend.nicepond-c7280126.westus2.azurecontainerapps.io + +# Azure +#BACKEND_URL=http://localhost:8080 +BACKEND_URL=https://petshop-backend.nicepond-c7280126.westus2.azurecontainerapps.io +``` + +Restart the dev server after changing. + +### Desktop + +Edit `desktop/src/main/resources/connectionpetstore.properties`: + +``` +# Local +api.baseUrl=http://localhost:8080 +#api.baseUrl=https://petshop-backend.nicepond-c7280126.westus2.azurecontainerapps.io + +# Azure +#api.baseUrl=http://localhost:8080 +api.baseUrl=https://petshop-backend.nicepond-c7280126.westus2.azurecontainerapps.io +``` + +### Android + +Edit `android/local.properties`: + +```properties +# Local (emulator — 10.0.2.2 maps to host's localhost) +petstore.backend.emulatorUrl=http\://10.0.2.2\:8080/ +petstore.backend.deviceUrl=http\://192.168.x.x\:8080/ + +# Azure +petstore.backend.emulatorUrl=https\://petshop-backend.nicepond-c7280126.westus2.azurecontainerapps.io/ +petstore.backend.deviceUrl=https\://petshop-backend.nicepond-c7280126.westus2.azurecontainerapps.io/ +``` + +Sync Gradle and re-run the app. + ## API A Postman collection is available at `backend/postman/`. Key endpoint groups: