From f291cde93784e3417ca8079aa2f4b2ddea34b6a9 Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Fri, 18 Feb 2022 13:28:08 +0100 Subject: [PATCH] Improve instructions for web console --- webconsole/DEVELOPMENT.md | 21 ++++++++++++++++----- webconsole/README.md | 11 ++++++----- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/webconsole/DEVELOPMENT.md b/webconsole/DEVELOPMENT.md index 7c319e219..6de7abaf9 100644 --- a/webconsole/DEVELOPMENT.md +++ b/webconsole/DEVELOPMENT.md @@ -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 ``` diff --git a/webconsole/README.md b/webconsole/README.md index ee27f8ab7..ab6f92ec7 100644 --- a/webconsole/README.md +++ b/webconsole/README.md @@ -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 `/console/`.