19 lines
731 B
JavaScript
19 lines
731 B
JavaScript
import axios from "axios";
|
|
import { LOCAL_SERVER_URL, getLocalServerHeaders } from "../config/index.js";
|
|
|
|
export async function fetchProjectInfo(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`, {
|
|
headers: getLocalServerHeaders(),
|
|
});
|
|
return response.data; // { success, projects: [...] }
|
|
}
|