Node.js 节点Pug:form标记的Action属性在使用变量时无法正常工作

Node.js 节点Pug:form标记的Action属性在使用变量时无法正常工作,node.js,express,pug,Node.js,Express,Pug,我有一个index.pug页面,它是: 头部 标题我的标题 身体 表单(method=“GET”,action='/{redirect\u url}') 按钮(type='submit')运行foo 在我的app.js中,我有: app.get('/', (req, res) => { res.render('index', { redirect_url: '/foo' }); }); app.get('/foo', (req, res) => {

我有一个index.pug页面,它是:

头部
标题我的标题
身体
表单(method=“GET”,action='/{redirect\u url}')
按钮(type='submit')运行foo
在我的app.js中,我有:

app.get('/', (req, res) => {
    res.render('index', {
        redirect_url: '/foo'
    });
});

app.get('/foo', (req, res) => {
    res.status(200).send('Foo triggered');
});
我被重定向到http://localhost:3000/?#{redirect_url}

我想重新定向到http://localhost:3000/redirect_url?

当我不使用变量时,它工作得很好

我附上了一个截图供参考

试试看

action=`${baseRoute}/${redirect_url}`