diff options
-rw-r--r-- | README.md | 6 | ||||
-rw-r--r-- | src/components/List.js | 2 | ||||
-rw-r--r-- | src/components/ObjectView.js | 2 |
3 files changed, 6 insertions, 4 deletions
@@ -2,12 +2,14 @@ ## Development setup -Run `soc_collector` on port 8000. The commit pointed to by the `soc_collector` submodule is compatible with `main` in this repo. +Run `soc_collector` and set env var `COLLECTOR_URL`. + +The commit pointed to by the `soc_collector` submodule is compatible with `main` in this repo. Populate `soc_collector` with data from `example_data.json`: ``` -cat example_data.json | curl -s -u user3:pw3 --data-binary @- http://localhost:8000/sc/v0/add +cat example_data.json | curl -s -u user3:pw3 --data-binary @- ${COLLECTOR_URL}/sc/v0/add ``` Get dependencies and start the front end: diff --git a/src/components/List.js b/src/components/List.js index bc74020..b93f2ee 100644 --- a/src/components/List.js +++ b/src/components/List.js @@ -24,7 +24,7 @@ class List extends React.Component { // Fetch data from external source, update state getData() { - fetch("http://localhost:8000/sc/v0/get", { + fetch(`${process.env.COLLECTOR_URL}/sc/v0/get`, { headers: { Authorization: "Basic " + btoa("user1:pw1") } diff --git a/src/components/ObjectView.js b/src/components/ObjectView.js index fc761ad..08951c0 100644 --- a/src/components/ObjectView.js +++ b/src/components/ObjectView.js @@ -17,7 +17,7 @@ class ObjectView extends React.Component { } getData() { - fetch(`http://localhost:8000/sc/v0/get/${this.props.id}`, { + fetch(`${process.env.COLLECTOR_URL}/sc/v0/get/${this.props.id}`, { headers: { Authorization: "Basic " + btoa("user1:pw1") } |