@oat-sa/tao-deliver-testrunner-fe
v1.3.0
Published
Next generation TAO Deliver progressive web application for any devices
Downloads
6
Maintainers
Keywords
Readme
TAO Deliver TestRunner FrontEnd
Setup
Requires node.js >= 10.0.0
.
git clone [email protected]:oat-sa/tao-deliver-testrunner-fe.git
cd tao-deliver-testrunner-fe
npm install
Run with the server API
The server must have the Same Origin Policy configured to allow calls from the current URL.
The URLs can be configured within the project configuration : src/config
.
In development mode
Running
- the frontend (using the development server) on http://localhost:8080
- the backend API on http://localhost:8001 or https://localhost:8443
- environment file
.env.dev
npm run dev
In production mode
Update the value in src/config/production.js
or modify .env
file
npm run build
and push the content of the dist
folder in a static web server.
Scripts
Available scripts in the project:
npm run dev
: compile and start a dev server with watchHOST=<host> PORT=<port> npm run test <testname>
: run test suiteHOST
(optional environment variable, default: 127.0.0.1): Test server listen hostPORT
(optional environment variable, default: 8082): Test server listen porttestname
(optional): Specific test to run. If it is not provided, all will be ran.
npm run test:keepAlive
: start test servernpm run build
: build for production intodist
directorynpm run lint
: check syntax of code
Docker
Environment variables
DELIVER_API_URL
: url of backend APIDELIVER_STATIC_URL
: url where the frontend files are located
Docker file contains multistage build, so if your system supports, you should enable it with export DOCKER_BUILDKIT=1
Create certificate
mkcert -cert-file ./docker/nginx/certs/cert.pem -key-file ./docker/nginx/certs/key.pem localhost
Production
docker-compose up -d
and you can load the frontend from https://localhost:8010
Development
Build: docker build --target dev -t tao_deliver_testrunner_fe:dev .
Run: docker run --init -v $(pwd)/src:/usr/src/app/src -v $(pwd)/build:/usr/src/app/build -p8080:8080 tao_deliver_testrunner_fe:dev
Test
Build: docker build --target test -t tao_deliver_testrunner_fe:test .
Run: docker run tao_deliver_testrunner_fe:test
MathJax support
Because of its Apache license, MathJax must be not be part of the default TAO Deliver install, but should be installable manually.
To install it:
- On cloning this repo, no code will be present in
/src/lib/mathjax
- In the project root, run
chmod +x scripts/MathJax_2.6.1_install_in_TAO_Deliver.sh
- Run
./scripts/MathJax_2.6.1_install_in_TAO_Deliver.sh
to download and extract MathJax. Sources will be installed into/src/lib/mathjax
and some assets will also be copied to/dist/mathjax
.