UNPKG

genezio

Version:

Command line utility to interact with Genezio infrastructure.

17 lines (16 loc) 671 B
import axios from "axios"; import { BACKEND_ENDPOINT } from "../constants.js"; import version from "../utils/version.js"; export async function getNewProjectTemplateList() { const templateListResponse = await axios.get(`${BACKEND_ENDPOINT}/github/templates`, { headers: { "Accept-Version": `genezio-cli/${version}`, }, }); // If compatibilityMapping is an empty string, set it to null const templateList = templateListResponse.data.templates.map((template) => ({ ...template, compatibilityMapping: template.compatibilityMapping === "" ? null : template.compatibilityMapping, })); return templateList; }