import { readFileSync } from 'node:fs'
import { join } from 'node:path'

export default defineEventHandler((event) => {
  const path = join(process.cwd(), 'public', 'data', 'auteurs-pensees.json')
  const raw = readFileSync(path, 'utf-8')
  setResponseHeader(event, 'content-type', 'application/json; charset=utf-8')
  setResponseHeader(event, 'cache-control', 'public, max-age=300')
  return raw
})
