docs: refresh project guidance and environment setup
Add env example defaults for Vite API and login settings, document template structure and page creation flow, and align agent guidance with current LLM development rules. Also allow committing the env example while keeping local env files ignored.docs: refresh project guidance and environment setup Add env example defaults for Vite API and login settings, document template structure and page creation flow, and align agent guidance with current LLM development rules. Also allow committing the env example while keeping local env files ignored.
This commit is contained in:
@@ -42,6 +42,16 @@ API module 應:
|
||||
|
||||
`client.ts` 的 `baseURL` 優先使用 `VITE_API_BASE_URL`,否則使用 `/service/api`。開發模式下,Vite proxy 會將 `/service/*` 轉送到後端。
|
||||
|
||||
template 提供 `.env.example` 作為環境變數範本。建立新專案時,複製成 `.env` 或對應 mode 的 env 檔,再填入實際 API 設定。
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
目前 `vite.config.mts` 的 dev proxy 會將 `/service/` 轉送到範例後端。正式專案若後端不同,優先調整 env 或 Vite proxy 設定,不要逐一修改 service module 裡的 endpoint。
|
||||
|
||||
production 不應沿用 template 內的示範後端位址,應由使用專案自己的部署環境提供 `VITE_API_BASE_URL`。
|
||||
|
||||
目前 API 呼叫範例:
|
||||
|
||||
- `authApi.getCaptcha()` -> `/Auth/get-captcha`
|
||||
|
||||
Reference in New Issue
Block a user