I build an app in node.js using Express server.
My app contain an index.js page, Dal.js page that will be able to return an array of DB function (insert,delete...).
I tried to do it in this way:
*
//index.js
var express = require('express');
var app = express();
Dal=require('./Server/DB/Dal')(app);
//Dal.js
module.exports=function(app)
{
var add=function(table,values, obj, next){
//tha action
}
var update=function(table,values, next){
//tha action
}
**return** {
Add:add,
Update:update
}
}
*
But it doesnt work!!
What is the problem??
Thanks in advance.