create: Tauri 动态分配单一端口
MemRelay-Operation: memory-save:rapt-decision-dynamic-port-20260927 MemRelay-Resource: 2e7e1895-f1ab-453d-ba93-29bfdfdd22fa
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
---
|
||||
title: Tauri 动态分配单一端口
|
||||
type: decision
|
||||
permalink: main/projects/280dd2a0-d23d-4a71-91e1-dce4353163be/tauri-动态分配单一端口
|
||||
stable_id: 2e7e1895-f1ab-453d-ba93-29bfdfdd22fa
|
||||
scope: project
|
||||
memory_type: decision
|
||||
project_id: 280dd2a0-d23d-4a71-91e1-dce4353163be
|
||||
usage_profile_id: 0c9feb46-d06e-43cd-9ef0-c5813c84a998
|
||||
status: active
|
||||
revision: 1
|
||||
request_id: rapt-decision-dynamic-port-20260927
|
||||
created_at: '2026-09-26T17:10:16.564765+00:00'
|
||||
updated_at: '2026-09-26T17:10:16.564765+00:00'
|
||||
tags:
|
||||
- desktop
|
||||
- port
|
||||
- tauri
|
||||
---
|
||||
|
||||
桌面启动改为 Tauri 拉起 FastAPI。启动时用 127.0.0.1:0 申请一个空闲端口,页面和接口共用这个端口。FastAPI 提供 /health,并在环境变量 RAPTD_STATIC 指向 dist/ui 时托管前端。Tauri 先显示 src-tauri/splash 的“后台程序正在启动”,/health 返回 200 后再跳到 http://127.0.0.1:端口/。关闭窗口时结束 Python 进程。不再使用固定的 8798 和 8799。开发命令是在仓库根目录执行 npm run tauri dev,启动前会先编译前端。
|
||||
Reference in New Issue
Block a user