v0.6.4 fixed help.md display

This commit is contained in:
2026-03-10 15:02:45 -04:00
parent 120f76c6f8
commit 09e6a75a9b
7 changed files with 113 additions and 9 deletions

View File

@@ -5,13 +5,14 @@ const path = require('path');
const { getDb } = require('../models/db');
const { authMiddleware } = require('../middleware/auth');
const HELP_FILE = '/app/data/help.md';
const HELP_FALLBACK = path.join(__dirname, '../../data/help.md');
// help.md lives inside the backend source tree — NOT in /app/data which is
// volume-mounted and would hide files baked into the image at build time.
const HELP_FILE = path.join(__dirname, '../data/help.md');
// GET /api/help — returns markdown content
router.get('/', authMiddleware, (req, res) => {
let content = '';
const filePath = fs.existsSync(HELP_FILE) ? HELP_FILE : HELP_FALLBACK;
const filePath = HELP_FILE;
try {
content = fs.readFileSync(filePath, 'utf8');
} catch (e) {