gpt4 book ai didi

node.js - 带哈希的 ExpressJS 渲染路径

转载 作者:太空宇宙 更新时间:2023-11-03 22:12:15 24 4
gpt4 key购买 nike

如何从 ExpressJS 应用程序中设置诸如 localhost:8080/foo#specialStuffHere 之类的 url?我在路由器中使用代码,例如:

app.get('/foo/', function (req, res) {
res.render('foo', {myData: data});
});

最佳答案

尝试使用命令 res.redirect(your url here) 而不是 res.render()

关于node.js - 带哈希的 ExpressJS 渲染路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38842827/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com