node.js - 如何在nodejs中发送变量以及重定向?
问题描述
#Following 在我的代码中进行重定向以及变量 innodejs
app.post("/newcall", function(req, res) {
var f = (req.body.try);
console.log("val"+ f)
res.sendFile(path.join(__dirname, "www/newcall.html"+f))
});
变量 F 包含数据hello
但是通过这样做,我在控制台中收到了这个错误
no such file or directory, stat'c\User\Asus\Desktop\Web\www\newcall\hello
你能告诉我吗?我在这段代码中缺少什么?谢谢
解决方案
推荐阅读
- vba - 如何覆盖 scripting.dictionary 中键的值?
- java - 根据递归划分数组
- oracle - 试图找出 Oracle 中 Rowid 的最大长度
- python - Python - 检查生成器是否为空
- azure - 如何监控 Azure 存储帐户的 IOPS
- python - 我可以在 Python 中使用 os.path.join() 加入网址还是有更好的方法?
- header - 删除 HeaderBar gtk3 vala
- c# - Viewbag“值不能为空”,但它不为空
- sapb1 - ODBC-2028 错误 SAP B1
- javascript - 淘汰赛:在加载时使用 ajax 加载可观察数组