问题
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