alexa

Typescript not working in javascript file in nodejs.

Typescript not working in javascript file in nodejs.

When you interact with DB, always send an Object. In this case, u need to send name, phone and crazy in the object.

 app.post('/new_contact', function(req, res){
var name = req.body.name;
var phone = req.body.phone;
db.insert(({name:name, phone:phone, crazy:true}), phone, function(err,header ){
    if(err){
        res.send("Error creating database "+ req.body.dbname);
        return;     
     }
     return res.send("contact created successfully");
    })
})

268 0
7

Write a Comments


* Be the first to Make Comment

GoodFirms Badge
GoodFirms Badge

Fix Your Meeting With Our SEO Consultants in India To Grow Your Business Online

Facebook
Twitter
LinkedIn
Instagram
Whatsapp
Call Now
Quick Inquiry