import {createProdMockServer} from 'vite-plugin-mock/es/createProdMockServer'

const context = import.meta.glob("./mocks/*.js", {eager: true})
const API = await import("../api/api")
const array = Object.keys(context).map(path =>
    Object.keys(context[path].default).map(url => ({
        url: API[url].split(' ')[0],
        method: API[url].split(' ').length > 1 ? API[url].split(' ')[1] : 'get',
        response: context[path].default[url]
    }))).reduce((r, m) => [...r, ...m])
console.log(array)
createProdMockServer([...array])