feat(datasource): update runtime config for datasource option

This commit is contained in:
Daniel Klein 2024-09-20 12:51:59 +02:00
parent 609e9ce500
commit c6e6be3bac
2 changed files with 4 additions and 1 deletions

View file

@ -63,6 +63,7 @@ export default defineNuxtConfig({
baseBranch: 'main',
repo: 'test-repo',
},
datasource: 'local',
},
},
})

View file

@ -1,4 +1,6 @@
export default defineEventHandler(async () => {
// return $fetch('https://explorer-data.web3privacy.info/')
const { datasource } = useRuntimeConfig()
if (datasource === 'remote')
return $fetch('https://explorer-data.web3privacy.info/')
return await useStorage('assets:server').getItem('data.json')
})