Muhammad Raihan Muhaimin Muhammad Raihan Muhaimin - 4 months ago 22x
Node.js Question

Getting rid of session and socket pooling sailsjs

Hi I am current working on my rest api app using sails. I was reading the following article

In point 2 it was suggested to get rid of socket pooling

var http = require('http');
var options = {.....};
options.agent = false;
var req = http.request(options)

and in point 7 it suggest to get rid of session by removing.

app.use(express.session({ secret: "keyboard cat" }));

I am wondering how I can do that in sails.


In Sails.js v0.10 you can disable the session by adding the following key to your config/express.js file:

middleware: {
   session: null

As far as socket pooling goes, I think they're talking about making http requests from the server, and just suggesting that when making such requests, you set the agent option to false.