access base http server of sails.js

爱⌒轻易说出口 提交于 2019-12-07 16:51:58

问题


Hi is there a way to access the base http server context of sails? I want to use binaryJS in my app and In the gettig started guide they are talking about creating the server at your own, it you have an existing express app with the following line:

var server = http.createServer(app).listen(9000);

than I could use the following binaryJS command:

// Create a BinaryServer attached to our existing server
var binaryserver = new BinaryServer({server: server, path: '/binary-endpoint'});

thank you


回答1:


In Sails v0.10.x, you can access the underlying Express server with:

sails.hooks.http.server

in v0.9.x, it's

sails.express.server


来源:https://stackoverflow.com/questions/24269988/access-base-http-server-of-sails-js

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!