mirror of
https://github.com/Nezumi-2711/Sink.git
synced 2026-09-22 13:48:35 +00:00
feat: init
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import type { H3Event } from 'h3'
|
||||
|
||||
export function useWAE(event: H3Event, query: string) {
|
||||
const { cfAccountId, cfApiToken } = useRuntimeConfig(event)
|
||||
console.log('useWAE', query)
|
||||
return $fetch(`https://api.cloudflare.com/client/v4/accounts/${cfAccountId}/analytics_engine/sql`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: `Bearer ${cfApiToken}`,
|
||||
},
|
||||
body: query,
|
||||
retry: 1,
|
||||
retryDelay: 100, // ms
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user