I'm using Recast.ai NLP Platform.I have create a simple bot on recast.ai console.Now,i want store my messages on MongoDb database.I have create a simple post type API for to save information on MongoDB. But i got stuck how to integrate or how to this from console.
My code for API :
app.post("/addname", (req, res) => {
console.log("called");
var myData = new User(req.body);
myData.save()
.then(item => {
res.send("Name saved to database");
})
.catch(err => {
res.status(400).send("Unable to save to database");
});
});