so i am creating a small application in Nodejs and Flask. I have created 2 apis. First one sending data from Nodejs App to Nodejs API then sending the data from the Nodejs API to flask api. I am having a bit of trouble sending the data from the Node Api to the Flask Api.
//send data from Node.js api to Flask Api
app.get('/postoflask', (req, res) => {
request('http://localhost:3030/users', (error, response, bodyParser) => {
if(error) {
res.send(' erorr occured')
}
else {
res.send(bodyParser)
request.post('http://localhost:5000/adduser')
}
});
});
Deploying the route on the browser retrieves the data from the node Api database and pushes null values to the flask api database. i need the data retrieved from the Node Api to be transferred as it is to the database of the flask database.
port 3030/users is the node api that fetches data from database and port 5000/adduser is flask api to push data into database.
I am an entry to mid-level programmer, but i don't know what i am missing here or what i am not understanding. Help will be very appreciated. Database used is PostgreSql.