【发布时间】:2021-03-10 03:19:36
【问题描述】:
嘿,伙计们,这是我的节点 js 代码我试图通过节点 js 呈现一个 html 文件,它返回空白屏幕,无论如何我可以在标题栏中看到正在读取文件。 如何呈现一个简单的 index.html 还是 node 中的 react js 包?
router.get('/', function (req, res) {
if (req.isAuthenticated())
{
res.sendFile(path.join(__dirname+'../../../build/index.html'));
console.log(res)
}
Here is the output on my screen which reads the title from my html file
【问题讨论】:
-
显示终端显示的错误
标签: html node.js reactjs express rendering