import fetch from 'node-fetch' import { readFile } from 'fs/promises' export async function getBuildRoutesMetadata(file) { console.log('Loading routes from disk...') const routesRaw = await readFile(file, 'utf8') return JSON.parse(routesRaw) } export async function getDevRoutesMetadata(url) { console.log('Loading routes from go server...') const routesReq = await fetch(url) const routes = await routesReq.json() return routes }