Reputation: 7123
I am new to nodejs i just want to bring data from event.js to app.js its in same directory but i could not get it working any idea how to make it work ?
app.js
var SnmpData = require('./event.js');
console.log('SNMP data',SnmpData);
event.js
var message = {
event: {
header: {
eventSource: "d-sms"
},
body: {
data: [
{
oid: "1.3.6.1.4.140.625",
host: "135.89.157.201",
port: "162",
value: "Problem with monitoring device",
type: ""
},
{
oid: "1.3.6.1.4.345.765",
host: "135.89.157.299",
port: "162",
value: "Problem with monitoring device-2",
type: ""
}],
message: "Activate Collaborate"
}
}
}
}
Upvotes: 0
Views: 32
Reputation: 1169
just add in the end of events.js
this :
exports.message = message ;
Also take a look to node modules to understand how things work.
Upvotes: 1