Merge branch 'the-lazy-me:main' into main

This commit is contained in:
fdc310
2025-06-09 22:26:59 +08:00
committed by GitHub
3 changed files with 15 additions and 7 deletions
+7 -3
View File
@@ -33,10 +33,14 @@ Install dependencies
npm install
```
Go to the `web/src/app/infra/http/HttpClient.ts` file and change `export const httpClient = new HttpClient('/');` at the bottom to `export const httpClient = new HttpClient('http://localhost:5300');` to ensure the frontend can access the standalone backend.
Start debugging
```bash
npm run dev
npm run dev:local
```
:::info
When using `dev:local` to start locally, the environment variable `NEXT_PUBLIC_API_BASE_URL` will be automatically used by the frontend to ensure that the frontend can access the `5300` port of the locally running backend. If you need to modify the backend address or port used, please modify the `scripts` in the `web/package.json` file.
In production environments, the frontend will be precompiled into static files and provided by the backend, and the frontend will automatically access the backend address on the same domain.
:::
Binary file not shown.

After

Width:  |  Height:  |  Size: 567 KiB

+8 -4
View File
@@ -33,10 +33,14 @@ uv run main.py
npm install
```
去`web/src/app/infra/http/HttpClient.ts`文件中,将最底部的`export const httpClient = new HttpClient('/');`修改为`export const httpClient = new HttpClient('http://localhost:5300');`,以确保前端可以访问到独立的后端。
启动调试
```bash
npm run dev
```
npm run dev:local
```
:::info
本地使用`dev:local`启动时,会携带环境变量`NEXT_PUBLIC_API_BASE_URL`,该变量会自动被前端使用,以确保前端可以访问到本地启动的后端的`5300`端口。如果您需要修改所使用的后端地址或端口,请到`web/package.json`文件中修改`scripts`中的`dev:local`命令。
生产环境中,前端会被预编译成静态文件,由后端提供服务,前端会自动访问同域的后端地址。
:::