This repository has moved to https://gitlab.developers.cam.ac.uk/uis/devops/iar/frontend
Frontend for IAR web application. Bootstrapped with Create React App.
npm install
To run locally, firstly start a local copy of the IAR backend, OAuth2 endpoint and lookupproxy:
docker-compose up
Then create the "testclient" OAuth2 client:
./scripts/create-client.sh
Then start the local development server:
npm start
NOTE: The "testclient" client can also be used to log into the asset register developer UI at http://localhost:8000/ui and also to log into the lookup proxy developer UI at http://localhost:8080/ui.
npm run build
npm test
npm run styleguide
Build time configuration is in the .env file.
This can be overridden locally by placing values in a .env.local
file.
Note that you must re-run npm start
for build time configuration to take
effect. Also note all vars names must be frefixed with REACT_APP_
. See
the
documentation
for more information.
Run time configuration is specified by setting the
window.reactAppConfiguration
variable. The recommended way to do this is
outlined in the .env:
- Add the
REACT_APP_INDEX_HTML_HEAD
build-time configuration value to.env.local
so that<script src="/config.local.js">
is inserted into the index.html file. - Copy the configuration template to
public/config.local.js
. - Add any local configuration to
public/config.local.js
.
Although you need to re-run npm start
after changing
REACT_APP_INDEX_HTML_HEAD
, changes to run-time configuration will
take effect on the next reload. Both .env.local
and
public/config.local.js
are added to .gitignore so that they
are not inadvertently checked into source control.
NOTE: In the test suite, configuration is loaded from a special module since index.html is not parsed when running tests.