Skip to content

Commit fc94117

Browse files
committed
Update readme
1 parent b0019d7 commit fc94117

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

README.md

+46
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,49 @@
11
# ocs-example-frontend
22

33
This is a frontend project demonstrating use of the ocs-components-lib, and the general capabilities of an observatory control system.
4+
5+
The easiest way to interact with this frontend is to run a full example project with the [ocs_example](https://github.com/observatorycontrolsystem/ocs_example).
6+
7+
## Environment variables
8+
9+
| Variable | Description | Default |
10+
| ------------------------------------- | ------------------------------------- | ----------------------- |
11+
| `VUE_APP_OBSERVATION_PORTAL_API_URL` | Observation portal API URL | `http://127.0.0.1:8000` |
12+
13+
## Project setup
14+
15+
Install the frontend dependencies:
16+
```
17+
npm install
18+
```
19+
20+
### Local Development
21+
22+
If you are developing locally, you will need to have a running [observation portal](https://github.com/observatorycontrolsystem/observation-portal).
23+
24+
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:
25+
26+
``` bash
27+
export CORS_ORIGIN_WHITELIST=http://127.0.0.1:8080
28+
export CSRF_TRUSTED_ORIGINS=127.0.0.1:8080
29+
```
30+
31+
Then, to run a hot-reload server for developing on the frontend:
32+
```
33+
npm run serve
34+
```
35+
36+
### Compile and minify for production
37+
```
38+
npm run build
39+
```
40+
41+
### Lint and fix files
42+
```
43+
npm run lint:fix
44+
```
45+
46+
### Check for linting errors without fixing them
47+
```
48+
npm run lint:check
49+
```

0 commit comments

Comments
 (0)