v0.6.4 fixed help.md display
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user