Skip to content

Commit 02265c9

Browse files
authored
chore: apply baseUrl convention across package-testing (#80)
1 parent 73dbe59 commit 02265c9

File tree

5 files changed

+17
-18
lines changed

5 files changed

+17
-18
lines changed

package-testing/php-sdk-relay/.env.EXAMPLE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Set your appropriate values and save as `.env`
2-
EPPO_BASE_URL=localhost:5000
2+
EPPO_BASE_URL=http://localhost:5000/api
33
EPPO_API_KEY=A123456780
44

55
SDK_RELAY_HOST=localhost

package-testing/php-sdk-relay/src/Config.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ class Config
1010
public function __construct()
1111
{
1212
$this->apiKey = $_ENV["EPPO_API_KEY"] ?? "NOKEYSPECIFIED";
13-
$apiServer = $_ENV["EPPO_BASE_URL"] ?? "localhost:5000";
14-
$this->apiServer = "http://${apiServer}";
13+
$this->apiServer = $_ENV["EPPO_BASE_URL"] ?? "http://localhost:5000/api";
1514
}
1615
}

package-testing/sdk-test-runner/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,13 @@ The test runner sends assignment and bandit action requests to the SDK Relay Ser
183183

184184
#### Configuration
185185

186-
| Variable Name | Type | Default | Description |
187-
| ---------------- | ------ | ---------------- | ----------------------------------------------------------------------- |
188-
| `SDK_RELAY_HOST` | string | `localhost` | Hostname for relay server |
189-
| `SDK_RELAY_PORT` | number | 4000 | Port for relay server |
190-
| `EPPO_BASE_URL` | string | `localhost:5000` | Base URL for api server, built from `EPPO_API_HOST` and `EPPO_API_PORT` |
191-
| `EPPO_API_HOST` | string | `localhost` | Hostname for api server |
192-
| `EPPO_API_PORT` | number | 5000 | Port for api server |
186+
| Variable Name | Type | Default | Description |
187+
| ---------------- | ------ | --------------------------- | ----------------------------------------------------------------------- |
188+
| `SDK_RELAY_HOST` | string | `localhost` | Hostname for relay server |
189+
| `SDK_RELAY_PORT` | number | 4000 | Port for relay server |
190+
| `EPPO_BASE_URL` | string | `http://localhost:5000/api` | Base URL for api server, built from `EPPO_API_HOST` and `EPPO_API_PORT` |
191+
| `EPPO_API_HOST` | string | `localhost` | Hostname for api server |
192+
| `EPPO_API_PORT` | number | 5000 | Port for api server |
193193

194194
#### API
195195

package-testing/sdk-test-runner/test-sdk.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fi
6363
# Allow env variables to be overwritten, then export to this shell.
6464
export EPPO_API_HOST="${EPPO_API_HOST:-localhost}"
6565
export EPPO_API_PORT="${EPPO_API_PORT:-5000}"
66-
export EPPO_BASE_URL="${EPPO_API_HOST}:${EPPO_API_PORT}"
66+
export EPPO_BASE_URL="http://${EPPO_API_HOST}:${EPPO_API_PORT}/api"
6767

6868
export SDK_RELAY_HOST="${SDK_RELAY_HOST:-localhost}"
6969
export SDK_RELAY_PORT="${SDK_RELAY_PORT:-4000}"

package-testing/testing-api/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ yarn start:prod
3232
yarn dev
3333
```
3434

35-
4. Navigate to [localhost:4000/flag-config/v1/config](localhost:4000/flag-config/v1/config) to verify UFC data is served.
35+
4. Navigate to [localhost:4000/api/flag-config/v1/config](http://localhost:4000/api/flag-config/v1/config) to verify UFC data is served.
3636

3737
### Customizing Server
3838
The following options are exposed via environment variables
@@ -52,23 +52,23 @@ EPPO_API_SERVER_PORT=3333 yarn dev
5252

5353
## Getting data from the server
5454

55-
The server will respond with UFC and Bandit model config data at `/flag-config/v1/config` and `/flag-config/v1/bandits` just as the current Eppo API server does via CDN. The server will also populate the _ETAG_ header and check the _IF-NONE-MATCH_ header and respond appropriately.
55+
The server will respond with UFC and Bandit model config data at `/api/flag-config/v1/config` and `/api/flag-config/v1/bandits` just as the current Eppo API server does via CDN. The server will also populate the _ETAG_ header and check the _IF-NONE-MATCH_ header and respond appropriately.
5656

5757
```shell
58-
curl --location 'localhost:5000/flag-config/v1/config?sdkName=fortran-sdk'
58+
curl --location 'localhost:5000/api/flag-config/v1/config?sdkName=fortran-sdk'
5959

6060
# Get Bandits
61-
curl --location 'localhost:5000/flag-config/v1/bandits?sdkName=fortran-sdk'
61+
curl --location 'localhost:5000/api/flag-config/v1/bandits?sdkName=fortran-sdk'
6262

6363
# See headers only
64-
curl --location 'localhost:5000/flag-config/v1/config?sdkName=fortran-sdk' -I
64+
curl --location 'localhost:5000/api/flag-config/v1/config?sdkName=fortran-sdk' -I
6565

6666
# Populate IF-NONE-MATCH with the current etag to verify empty response
67-
curl --location 'localhost:5000/flag-config/v1/config?sdkName=fortran-sdk' \
67+
curl --location 'localhost:5000/api/flag-config/v1/config?sdkName=fortran-sdk' \
6868
--header 'IF-NONE-MATCH: 79689d5810a263a40fc179be057e743d'
6969

7070
# Show just the headers to see response code 304:not modified
71-
curl --location 'localhost:5000/flag-config/v1/config?sdkName=fortran-sdk' \
71+
curl --location 'localhost:5000/api/flag-config/v1/config?sdkName=fortran-sdk' \
7272
--header 'IF-NONE-MATCH: 79689d5810a263a40fc179be057e743d' -I
7373

7474

0 commit comments

Comments
 (0)