From dfea2265179eb4cacf96cc80fd9c6d6498091772 Mon Sep 17 00:00:00 2001 From: xzchaoo Date: Thu, 11 May 2023 23:18:02 +0800 Subject: [PATCH] docs: update front docs --- docs/src/en/SUMMARY.md | 1 + docs/src/en/dev-guide/front/build.md | 10 ++----- docs/src/en/dev-guide/front/run.md | 45 ++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 docs/src/en/dev-guide/front/run.md diff --git a/docs/src/en/SUMMARY.md b/docs/src/en/SUMMARY.md index 2741ec3..646b276 100644 --- a/docs/src/en/SUMMARY.md +++ b/docs/src/en/SUMMARY.md @@ -39,6 +39,7 @@ - [Log](dev-guide/log/README.md) - [Front](dev-guide/front/README.md) - [Build](dev-guide/front/build.md) + - [Run](dev-guide/front/run.md) - [Internals](dev-guide/internals/README.md) - [Log multiline](dev-guide/internals/log-multiline.md) - [GPU](dev-guide/internals/gpu.md) diff --git a/docs/src/en/dev-guide/front/build.md b/docs/src/en/dev-guide/front/build.md index be56743..1bfa59e 100644 --- a/docs/src/en/dev-guide/front/build.md +++ b/docs/src/en/dev-guide/front/build.md @@ -2,15 +2,11 @@ Compile requirements: - node - yarn -Install dependencies -```bash -yarn -``` - Build dist ```bash -yarn run build +./scripts/front/build.sh ``` Build result: -- dist/ +- front/dist/: html/js/css/assets +- front/dist.zip: the zip of `front/dist/` diff --git a/docs/src/en/dev-guide/front/run.md b/docs/src/en/dev-guide/front/run.md new file mode 100644 index 0000000..296b794 --- /dev/null +++ b/docs/src/en/dev-guide/front/run.md @@ -0,0 +1,45 @@ +Before you run the front-end code, you need to have a running HoloInsight backend, you can refer to [this document](../test/README.md#deployment-for-testing) to start a backend. + +Suppose the address of the backend is `http://xx.xx.xx.xx:12345`, you need to configure `./front/config/config.ts`: + +```ts +export default defineConfig({ + ... + proxy: { + '/webapi/': { + target: 'http://xx.xx.xx.xx:12345', + changeOrigin: true, + }, + } + ... +}); +``` + +Run front dev server: +```bash +cd front/ && yarn run dev +``` + +Example output: +```text +$yarn run dev +yarn run v1.22.19 +$ max dev +info - Umi v4.0.68 +info - Preparing... +info - MFSU eager strategy enabled +[HPM] Proxy created: /webapi/ -> http://xx.xx.xx.xx:12345 +event - [MFSU][eager] start build deps +info - [MFSU] buildDeps since cacheDependency has changed + ╔════════════════════════════════════════════════════╗ + ║ App listening at: ║ + ║ > Local: http://localhost:8000 ║ +ready - ║ > Network: http://xx.xx.xx.xx:8000 ║ + ║ ║ + ║ Now you can open browser with the above addresses↑ ║ + ╚════════════════════════════════════════════════════╝ +info - [MFSU][eager] worker init, takes 562ms +... +``` + +Visit the front pages at `http://xx.xx.xx.xx:8000`.