diff --git a/client/.env b/client/.env new file mode 100644 index 00000000..fec02184 --- /dev/null +++ b/client/.env @@ -0,0 +1 @@ +REACT_APP_REST_SERVER_ADDRESS="http://127.0.0.1:8080" \ No newline at end of file diff --git a/client/src/README.md b/client/src/README.md new file mode 100644 index 00000000..293d0c22 --- /dev/null +++ b/client/src/README.md @@ -0,0 +1,15 @@ +# WEB CLIENT for ROOMKN + +## Run + +`npm run start` + +## Build + +`npm run build` + +Built static files in `./build` + +## Environment variables + +`REACT_APP_REST_SERVER_ADDRESS` \ No newline at end of file diff --git a/client/src/api/API.js b/client/src/api/API.js index 3284c513..66e92238 100644 --- a/client/src/api/API.js +++ b/client/src/api/API.js @@ -1,8 +1,9 @@ import { useEffect, useState } from 'react'; -const API_HOST = "http://127.0.0.1:8080" +const API_HOST = process.env.REACT_APP_REST_SERVER_ADDRESS export function useAPI(url, data=null, method='GET') { + console.log(API_HOST) const [result, setResult] = useState(); const [loading, setLoading] = useState(true); const [finished, setFinished] = useState(false);