“[circuit_breaking_exception] [parent]” Data too large, data for “[]” would be error

After some more research finally, I found a solution for this i.e We should not disable circuit breaker as it might result in OOM error and eventually might crash elasticsearch. dynamically increasing circuit breaker memory percentage is good but it is also a temporary solution because at the end after solution increased percentage might also … Read more

Socket.IO without http server?

Socket.io, and WebSockets in general, require an http server for the initial upgrade handshake. So even if you don’t supply Socket.io with an http server it will create one for you. The issue is that the second parameter in your io.listen(3000, ‘0.0.0.0’) is ignored by Socket.io. If you need to control which network interface to … Read more

‘babel-core/register’ vs ‘babel-register’

They are the same. All babel-core/register does is require(‘babel-register’). https://github.com/babel/babel/blob/cb8c4172ef740aa562f0873d602d800c55e80c6d/packages/babel-core/register.js#L3 The recommended usage is babel-register since that is the module where the code actually lives, and babel-core/register has been removed in Babel 7.x. Better to depend specifically on the module you use, rather than load it as a side-effect of babel-core.

Node.js REST API versioning the right way?

Instead of adding version in every route you can add it in app level. So It won’t be tightly coupled with API route. import * as express from ‘express’; // v1/get-ride.js const router = express.Router(); router.post(‘/rides/:id’, dep.verifyToken(), (req, res) => { // Your code }); app.use(‘/v1’, router); // v2/get-ride.js const router = express.Router(); router.post(‘/rides/:id’, dep.verifyToken(), … Read more

The simplest possible reverse proxy [closed]

Found http://mitmproxy.org/ ! My use case is covered by: mitmproxy -p 8080 -P https://remote.site.example.com/ But there’s more. It also offers an ncurses UI for showing all requests done, and allows you to inspect them. This makes WireShark unnecessary. Install with your distro package installer or with easy_install as shown in the question: virtualenv mitmproxy; cd … Read more

In Node.js how can I tell the path of `this` module?

As david van brink mentioned in the comments, the correct solution is to use __dirname. This global variable will return the path of the currently executing script (i.e. you might need to use ../ to reach the root of your module). For example: var path = require(“path”); require(path.join(__dirname, ‘/models’)); Just to save someone from a … Read more

Post request via Chai

The way you have written, I assume that you used chai-http package. The .field() function does not work in chai-http. Another user pointed it out here and opened an issue on github. Here is how you could have written: .set(‘content-type’, ‘application/x-www-form-urlencoded’) .send({myparam: ‘test’}) Here is the full code that successfully passes parameters to the server: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)