2
我正在運行一個coap服務器,並且隨着我開始添加路由,維護我自己的路由有點乏味,所以我想我會切換到表達式(我已經用於http服務器)。使用高速路由與非http(coap)
現在,鑑於它基本上使用了與server.on("request", (req, res) => {...})
相同的格式,我認爲它是兼容的,但是express會添加不屬於coap規範的各種頭文件。
我想要做的只是使用我的應用程序的快速路由的便利。這可能嗎?目前我在做這個:
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)