Añadido el modo producción / test

This commit is contained in:
Jordan Diaz
2026-04-08 23:52:54 +00:00
parent c1a29bbbf8
commit 993e7d3000
9 changed files with 240 additions and 90 deletions

View File

@@ -1,14 +1,18 @@
import axios from "axios";
import { LOCAL_SERVER_URL } from "../config/index.js";
import { LOCAL_SERVER_URL, getLocalServerHeaders } from "../config/index.js";
export async function fetchProjectInfo(projectName) {
const response = await axios.get(`${LOCAL_SERVER_URL}/api/mcp/project-info`, {
params: { project: projectName }
const params = typeof projectName === "string" ? { project: projectName } : (projectName || {});
const response = await axios.get(`${LOCAL_SERVER_URL}/api/project-info`, {
params,
headers: getLocalServerHeaders(),
});
return response.data; // { success, web_url, token, tokenHash, domain, project_dir }
}
export async function fetchProjectsList() {
const response = await axios.get(`${LOCAL_SERVER_URL}/api/mcp/projects`);
const response = await axios.get(`${LOCAL_SERVER_URL}/api/mcp/projects`, {
headers: getLocalServerHeaders(),
});
return response.data; // { success, projects: [...] }
}