2020-05-23 18:36:15 +00:00
|
|
|
# Console
|
|
|
|
|
|
|
|
Apollo GraphQL client.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2020-05-26 02:16:25 +00:00
|
|
|
First start the server:
|
|
|
|
|
2020-05-23 18:36:15 +00:00
|
|
|
```bash
|
2020-05-27 23:09:20 +00:00
|
|
|
cd packages/console-server
|
2020-05-23 18:36:15 +00:00
|
|
|
yarn start
|
|
|
|
```
|
|
|
|
|
2020-05-26 02:16:25 +00:00
|
|
|
Then start the Webpack devserver.
|
|
|
|
|
|
|
|
```bash
|
2020-06-08 21:10:00 +00:00
|
|
|
cd packages/console-app
|
2020-05-26 02:16:25 +00:00
|
|
|
yarn start
|
|
|
|
```
|
2020-05-23 18:36:15 +00:00
|
|
|
|
2020-05-26 02:16:25 +00:00
|
|
|
Then load the app: http://localhost:8080.
|
2020-05-23 18:36:15 +00:00
|
|
|
|
2020-07-20 17:14:04 +00:00
|
|
|
## Using a KUBE
|
|
|
|
|
2020-07-20 17:42:15 +00:00
|
|
|
To use your KUBE for testing, rather than running all the services locally, specify a different
|
|
|
|
config file when starting: `config-kube.yml`, which connects to `kube.local` for all services.
|
2020-07-20 17:14:04 +00:00
|
|
|
|
|
|
|
For example:
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
cd packages/console-app
|
|
|
|
CONFIG_FILE=config-kube.yml yarn start
|
|
|
|
```
|
|
|
|
|
2020-05-23 18:36:15 +00:00
|
|
|
## Deploy
|
|
|
|
|
|
|
|
```bash
|
|
|
|
yarn build
|
|
|
|
```
|
|
|
|
|
|
|
|
This creates the following folders:
|
|
|
|
|
|
|
|
```
|
|
|
|
/dist
|
|
|
|
/es # Module imports.
|
|
|
|
/production # Production build.
|
|
|
|
```
|
|
|
|
|
|
|
|
NOTE: GQL and Production files and exported and may be used by the server.
|
|
|
|
|
|
|
|
```javascript
|
2020-05-24 13:55:36 +00:00
|
|
|
import QUERY_STATUS from '@dxos/console-client/gql/system_status.graphql';
|
2020-05-23 18:36:15 +00:00
|
|
|
import config from '@dxos/console-client/config.json';
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
const file = path.join(__dirname + '../../../../node_modules/@dxos/console-client/dist/production', 'index.html');
|
|
|
|
res.sendFile(file);
|
|
|
|
```
|