import fs from 'fs'
import path from 'path'

export default defineEventHandler(async (event) => {
  let docsDir = "";
  if (process.env.NODE_ENV === "development") {
    docsDir = path.resolve(process.cwd(), "content/documentation");
  } else {
    docsDir = path.resolve(process.cwd(), "../content/documentation");
  }
  const files = fs.readdirSync(docsDir)
    .filter(file => file.endsWith('.md'))
  return files
}) 