Tag: coap

使用非http(coap)快速路由

我正在运行一个CoP服务器,而且由于我已经开始添加路由,维护自己的路由有点繁琐,所以我认为我会切换到express(我已经用于http服务器)。 现在,鉴于它使用基本上相同的格式server.on("request", (req, res) => {…}) ,我认为它是兼容的,但expression增加了不同的头不在Coap spec。 我想要做的只是使用我的应用程序的快速路由的便利。 这可能吗? 我目前正在这样做: const server = coap.createServer(…); const app = express(); server.on("request", app); 结果是这个错误: Uncaught Error: Unknown string to Buffer converter for option: X-Content-Type-Options at module.exports.toBinary (node_modules/coap/lib/option_converter.js:21:11) at OutMessage.setOption (node_modules/coap/lib/helpers.js:56:16) at Immediate.write (node_modules/finalhandler/index.js:164:9)