Md Afiq Iskandar e4548647b5 Update Documentation and Configuration for Corrad ProcessMaker
- Added comprehensive documentation covering key features, user guides, and best practices for the Corrad ProcessMaker platform.
- Introduced new API endpoints for serving documentation files dynamically.
- Enhanced the navigation structure to include a dedicated documentation section for improved accessibility.
- Updated the Nuxt configuration to optimize the development environment and ensure proper handling of dependencies.
- Included new dependencies in package.json to support documentation rendering and processing.
- Improved the user interface for the documentation page, enhancing the overall user experience.
2025-07-24 17:17:11 +08:00

13 lines
432 B
JavaScript

import fs from 'fs'
import path from 'path'
export default defineEventHandler(async (event) => {
const { file } = event.context.params
const docsDir = path.resolve(process.cwd(), 'content/documentation')
const filePath = path.join(docsDir, file)
if (!file.endsWith('.md') || !fs.existsSync(filePath)) {
return { error: 'File not found' }
}
const content = fs.readFileSync(filePath, 'utf-8')
return { content }
})