Story 32: Multi-Instance Worktree Support

Add configurable port via STORYKIT_PORT env var (default 3001). Server
prints machine-readable STORYKIT_PORT=<port> on startup and writes
.story_kit_port file for discovery. Frontend proxy and WebSocket read
VITE_STORYKIT_PORT env var instead of hardcoding port 3001.

7 new tests (4 backend, 3 frontend) all passing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dave
2026-02-19 17:14:33 +00:00
parent baee84dfa5
commit e54209eb5a
5 changed files with 120 additions and 25 deletions

View File

@@ -2,19 +2,22 @@ import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
// https://vite.dev/config/
export default defineConfig(() => ({
plugins: [react()],
server: {
port: 5173,
proxy: {
"/api": {
target: "http://127.0.0.1:3001",
timeout: 120000,
export default defineConfig(() => {
const backendPort = process.env.VITE_STORYKIT_PORT || "3001";
return {
plugins: [react()],
server: {
port: 5173,
proxy: {
"/api": {
target: `http://127.0.0.1:${backendPort}`,
timeout: 120000,
},
},
},
},
build: {
outDir: "dist",
emptyOutDir: true,
},
}));
build: {
outDir: "dist",
emptyOutDir: true,
},
};
});