所以我有这个发布说明标记文件,它以HTML格式显示:
app.get('/release-notes', (req, res) => {
// Serve the file
var data = marked(fs.readFileSync(path.resolve(__dirname, './release-notes.md'), 'utf8'));
var template = fs.readFileSync(path.resolve(__dirname, './release-notes.html'), 'utf8');
res.send(template.replace('[[CONTENT]]', data));
});
在本地测试时,它可以工作,但是当我进行部署时,我得到:
Error: ENOENT: no such file or directory, open '/usr/src/server/release-notes.html'
at Object.openSync (fs.js:454:3)
at Object.readFileSync (fs.js:354:35)
at /usr/src/server/app.js:212:27
release-notes.html和release-notes.md位于同一文件夹中。
我不知道怎么了?