refactor: 统一使用 PORT 环境变量替代 NITRO_PORT
- 将环境变量从 NITRO_PORT 更改为 PORT - 将 sidecar 的环境变量从 NITRO_PORT 改为 PORT
This commit is contained in:
@@ -299,7 +299,7 @@ let sidecar = app_handle
|
|||||||
.shell()
|
.shell()
|
||||||
.sidecar("server")
|
.sidecar("server")
|
||||||
.expect("无法找到 server sidecar")
|
.expect("无法找到 server sidecar")
|
||||||
.env("NITRO_PORT", port.to_string());
|
.env("PORT", port.to_string());
|
||||||
|
|
||||||
// 清理进程
|
// 清理进程
|
||||||
match event {
|
match event {
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ pub fn spawn_sidecar(app_handle: tauri::AppHandle) {
|
|||||||
.shell()
|
.shell()
|
||||||
.sidecar("server")
|
.sidecar("server")
|
||||||
.expect("无法找到 server")
|
.expect("无法找到 server")
|
||||||
.env("NITRO_PORT", port.to_string());
|
.env("PORT", port.to_string());
|
||||||
|
|
||||||
let (mut rx, child) = sidecar.spawn().expect("启动 sidecar 失败");
|
let (mut rx, child) = sidecar.spawn().expect("启动 sidecar 失败");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user