feat: ora funge tutto benissimo per qualche motivo

This commit is contained in:
2023-02-02 01:25:12 +01:00
parent be57412c40
commit 2b47950556
20 changed files with 890 additions and 108 deletions
+18
View File
@@ -0,0 +1,18 @@
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
}