How to replicate between On-Premises and Azure in Mongodb

I have three 3 node cluster on-premises ( 1 Primary and 2 Secondary ). I have same 3 node cluster in AZURE ( 1 Primary and 2 Secondary ) with same version and data but with different FQDN in azure. How shall I connect mongodb replica set in azure to mongodb replica set in on-premises so that they can start replicating the data. Later I would like to switch off on-premises mongodb and move finally to azure. My question is:

Error [ERR_HTTP_HEADERS_SENT] Cannot set headers after they are sent to the client

The question: at ServerResponse.setHeader (_http_outgoing.js:470:11) at ServerResponse.header (C:rootnode_modulesexpresslibresponse.js:771:10) at ServerResponse.send (C:rootnode_modulesexpresslibresponse.js:170:12) at ServerResponse.json (C:rootnode_modulesexpresslibresponse.js:267:15) at ServerResponse.send (C:rootnode_modulesexpresslibresponse.js:158:21) at (C:rootrouteapilistsData.js:223:32) at C:rootnode_modulesmongooselibmodel.js:4604:16 at C:rootnode_modulesmongooselibutils.js:268:11 at $__save.error (C:rootnode_modulesmongooselibmodel.js:472:16) at C:rootnode_moduleskareemindex.js:246:48 at next (C:rootnode_moduleskareemindex.js:167:27) at next (C:rootnode_moduleskareemindex.js:169:9) at Kareem.execPost (C:rootnode_moduleskareemindex.js:217:3) at _handleWrapError (C:rootnode_moduleskareemindex.js:245:21) at C:rootnode_moduleskareemindex.js:272:14 at _next (C:rootnode_moduleskareemindex.js:94:14) Emitted ‘error’ event at: Please help, I was facing … Read more

React POST requests with Express/Node and MongoDB

I’m writing program that uses React as front-end, and an Express/Node API for the backend which then does CRUD operations in a MongoDB database. Right now, I’m using the native JS fetch() API to perform GET/POST operations on my front end. The GET requests work just fine, but my POST requests seem to not be working. On my front end, I have a form and a handler for form submission like so: