Mirror of design_agent_front/design-agent/ for shipping alongside backend.
Vite plugin (vitePluginPhaseZApi) endpoints :
- POST /api/run — spawn `python -m src.phase_z2_pipeline` with overrides
- GET /api/sample-mdx?mdx=03/04/05 — fixed sample MDX
- GET /frame-preview/{n} — figma preview thumbnails
- GET /data/runs/{run_id}/{path} — pipeline artifacts (final.html, step*.json, ...)
Env toggle forward (보고용) :
PHASE_Z_ALLOW_RESTRUCTURE / PHASE_Z_ALLOW_REJECT / PHASE_Z_MAX_RANK=32
Components :
- LeftMdxPanel (03/04/05 fix list + section tree)
- SlideCanvas (iframe + slideOverrideCss prop for inline CSS inject)
- FramePanel (label priority + confidence sort)
- LayoutPanel
README with mermaid diagrams covering the 5-step demo flow.
node_modules / dist / .manus-logs / .env excluded via .gitignore.
34 lines
919 B
TypeScript
34 lines
919 B
TypeScript
import express from "express";
|
|
import { createServer } from "http";
|
|
import path from "path";
|
|
import { fileURLToPath } from "url";
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
|
|
async function startServer() {
|
|
const app = express();
|
|
const server = createServer(app);
|
|
|
|
// Serve static files from dist/public in production
|
|
const staticPath =
|
|
process.env.NODE_ENV === "production"
|
|
? path.resolve(__dirname, "public")
|
|
: path.resolve(__dirname, "..", "dist", "public");
|
|
|
|
app.use(express.static(staticPath));
|
|
|
|
// Handle client-side routing - serve index.html for all routes
|
|
app.get("*", (_req, res) => {
|
|
res.sendFile(path.join(staticPath, "index.html"));
|
|
});
|
|
|
|
const port = process.env.PORT || 3000;
|
|
|
|
server.listen(port, () => {
|
|
console.log(`Server running on http://localhost:${port}/`);
|
|
});
|
|
}
|
|
|
|
startServer().catch(console.error);
|