feat: 完成 ApiState Temporal native 开发链

This commit is contained in:
root
2026-07-17 03:41:59 +02:00
parent d203b22183
commit 02b21ad891
17 changed files with 214 additions and 81 deletions
+25
View File
@@ -0,0 +1,25 @@
import { defineConfig } from "vite";
import { loadConfig } from "./src/config";
const configPath = process.env.APISTATE_CONFIG_PATH;
const runtimeId = process.env.APISTATE_RUNTIME_ID;
if (!configPath) throw new Error("Vite requires APISTATE_CONFIG_PATH");
if (!runtimeId) throw new Error("Vite requires APISTATE_RUNTIME_ID");
const config = loadConfig(configPath);
const target = config.runtime.serverTargets[runtimeId];
if (!target) throw new Error(`runtime.serverTargets.${runtimeId} does not exist`);
export default defineConfig({
root: "static",
server: {
host: target.webListenHost,
port: target.webListenPort,
strictPort: true,
watch: { usePolling: true, interval: 300 },
proxy: {
"/api": { target: target.webApiBaseUrl, changeOrigin: true },
"/health": { target: target.webApiBaseUrl, changeOrigin: true },
},
},
});