feat: ora funge tutto benissimo per qualche motivo
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user