export default async function strapiHelper(event: any, url: string, method: string = 'GET', body: any) {
  const config = useRuntimeConfig()

  let options: any = {}
  if(body) {
    options = {
      ...options,
      body: body
    }
  }
  
  return await $fetch(config.api.strapi+'/'+url, {
    method: method,
    headers: {
      Authorization: 'Bearer '+config.api.strapitoken
    },
    ...options
  })
}