3
0

Improve instructions for web console

This commit is contained in:
Denis Arh
2022-02-18 13:28:08 +01:00
parent ef904e0cd3
commit f291cde937
2 changed files with 22 additions and 10 deletions

View File

@@ -1,5 +1,16 @@
# Corteza Server Web Console
## Setting up
When developing web-console backend (API) base URL must be set to the actual server. That can be achieved by setting a URL as value local store item with `console-api-base-url` as key:
```javascript
localStorage.setItem('console-api-base-url', '//localhost:3000/console')
```
Make sure console and all required routes are enabled on the server (`ENVIRONMENT=dev` and/or `HTTP_WEB_CONSOLE_ENABLED=true`).
Also make sure username and password is disabled for the console for development.
## Type Support for `.vue` Imports in TS
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
@@ -18,29 +29,29 @@ See [Vite Configuration Reference](https://vitejs.dev/config/).
## Project Setup
```sh
npm install
yarn install
```
### Compile and Hot-Reload for Development
```sh
npm run dev
yarn dev
```
### Type-Check, Compile and Minify for Production
```sh
npm run build
yarn build
```
### Run Unit Tests with [Vitest](https://vitest.dev/)
```sh
npm run test:unit
yarn test:unit
```
### Lint with [ESLint](https://eslint.org/)
```sh
npm run lint
yarn lint
```

View File

@@ -2,10 +2,11 @@
When enabled (`HTTP_WEB_CONSOLE_ENABLED=true`), it allows insight and management of corteza internals.
## Web Console development
## Running server and web console both from source
When developing web-console backend (API) base URL must be set to the actual server. That can be achieved by setting a URL as value local store item with `console-api-base-url` as key:
See [DEVELOPMENT.md](DEVELOPMENT.md) for details.
```javascript
localStorage.setItem('console-api-base-url', '//localhost:3000/console')
```
## Running server from source and using bundled web console
If you want to use web console while do changes on the server you need to bundle it.
Run `yarn build` and make sure you enable dev mode with `ENVIRONMENT=dev`, restart the server and navigate your browser to `<server>/console/`.