This is a frontend project demonstrating use of the ocs-components-lib, and the general capabilities of an observatory control system.
The easiest way to interact with this frontend is to run a full example project with the ocs_example.
Variable | Description | Default |
---|---|---|
VUE_APP_OBSERVATION_PORTAL_API_URL |
Observation portal API URL | http://127.0.0.1:8000 |
Install the frontend dependencies:
npm install
If you are developing locally, you will need to have a running observation portal.
Make sure you enable cross origin resource sharing for the frontend domain when running the observation portal. For example, if your frontend is running at http://127.0.0.1:8080
, you could set the following environment variables for the observation portal:
export CORS_ORIGIN_WHITELIST=http://127.0.0.1:8080
export CSRF_TRUSTED_ORIGINS=127.0.0.1:8080
Note: 127.0.0.1 and localhost are not interchangable here. If you want both to work in the browser, set both values in the configdb variables (ie. export CSRF_TRUSTED_ORIGINS=127.0.0.1:8080,localhost:8080
).
Then, to run a hot-reload server for developing on the frontend:
npm run serve
npm run build
npm run lint:fix