ColdFusion http 请求调用 NodeJS/Express

问题描述

我在使用 ColdFusion cfhttp 调用 NodeJS 应用程序时遇到了一个奇怪的问题。它返回状态 200 OK,但它从不调用 NodeJS 函数

NodeJS app.js

const mainRoute= require('./routes/mainRoute');

app.use('/mainRoute',mainRoute);

mainRoute.js

const myController = require('../../controllers/myController');

router.get('/abc/test',myController.getReport);

控制器:

exports.getReport = async (req,res,next) => {
   console.log('here');
}

当我使用浏览器运行它时,它工作正常并显示日志```here``

我尝试在我的 ColdFusion 应用程序中运行它:

<cfhttp result="reportURL" method="GET" charset="utf-8" url="http://localhost:3006/mainRoute/abc/test">
</cfhttp>

<cfdump var="#reportURL#" />

它返回从不显示运行 NodeJS 的应用程序中的日志 here,coldfusion dump 中的输出如下图

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)