Skip to content

Commit

Permalink
docs: update front docs
Browse files Browse the repository at this point in the history
  • Loading branch information
xzchaoo committed May 11, 2023
1 parent a7a9196 commit dfea226
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 7 deletions.
1 change: 1 addition & 0 deletions docs/src/en/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 3 additions & 7 deletions docs/src/en/dev-guide/front/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/`
45 changes: 45 additions & 0 deletions docs/src/en/dev-guide/front/run.md
Original file line number Diff line number Diff line change
@@ -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`.

0 comments on commit dfea226

Please sign in to comment.