Añadido el modo producción / test
This commit is contained in:
@@ -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: [...] }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user