i am new in nodejs,i need to export function in nodejs   

**db\_function.js** file

```
var mysql = require('mysql'); 
var config  = require('./config.js');
var con = config.conn;

exports.is_valid_IP = {
 function(IP,callback)
  {
    con.connect(function(err) {
      if (err) throw err;
      con.query("SELECT * FROM server_master", function (err, result, fields) {
        if (err) throw err;
        callback(result);
      });
    });
  }
};

```

**app.js** file

```
  app.get('/test',function(req,res){
  var IP = 1;
  db.is_valid_IP(IP,function(result){
    console.log(result);
  });
});

```

It Show error **Cannot call method 'connect' of undefined**