Reputation: 4309
We are running on Amazon, using node with express, and connect-mongostore to manage the sessions. The load balancer sends a test to the servers every 15 seconds to make sure the app is alive. We have coded an API call for it to check, which tests if both node and mongo are working. However, this creates a session, with each call, as it's not a web browser, so a new session record gets built. We have 80,000 records in our session database, that expire every four weeks. Wondering if there is any way to prevent this happening, without having to hack either express or connect-mongostore.
Upvotes: 0
Views: 158
Reputation: 4363
At one time you could ignore specific routes from connect's session management with connect.session.ignore.push('/individual/path')
, but this has been removed.
Why not put one public route app.getapp.use('/lbChck', function(req,res){ res.send(200);})
for the load balancer before app.use(express.session(...));
?
Upvotes: 1