export default defineEventHandler(async () => {
  const data = await readYaml<{ messages: any[] }>('messages.yml')
  const published = data.messages
    .filter(m => m.published)
    .sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime())
  return published
})
