explorer-app/server/api/data.get.ts

6 lines
251 B
TypeScript

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