nodesnap
v1.0.2
Published
Service-Oriented node async protocol middleware
Downloads
2
Readme
node-snap
Service-Oriented Node Asynchronus middleware
An easy-to-use event routing engine with interface stacks for nodejs
Extra features:
- provides powerfull Event Routing Engine
- Supports traditional programming apps
- Supports Finate state machine applications
- Interface Stacks to communicate with other applications
- Supports multiple databases like mysql, mssql
Installation
npm install nodesnap
Usage
var snap = require('nodesnap'); var app1 = require('SubscriberApp1');
var CONFIG_FILENAME = './conf/appconfig.json'; try { snap.init(CONFIG_FILENAME); snap.loadSubscriber(app1); } catch(e) { console.log('Error: '+e.stack); }
process.on('uncaughtException', function(err) { console.log(err.stack); });
/*this fucntion closes the traces files and records process's uptime when the process exits */ process.on('exit', function() { console.log ('Exiting ...'); console.log('process uptime : '+process.uptime()); snap.exit(); });
Configuration - JSON format
{ "CORE":{
"TRACING" :{"TRACELEVEL": "255", "MODE":"2"}
},
"MODULES":[
{"NAME": "dispclient",
"LOAD": "yes",
"PARAMS": {"ROLE": "CLIENT", "PORT": 8000, "HOST": "127.0.0.1", "MSGTYPE": "JSON"}
},
{"NAME": "tcpbasicstack",
"LOAD": "no",
"PARAMS": {"ROLE": "CLIENT", "PORT": 8000, "HOST": "127.0.0.1", "MSGTYPE": "JSON"}
},
{"NAME": "dbstack",
"LOAD": "NO",
"PARAMS": {"DBTYPE": "MYSQL", "PORT": 3306, "HOST": "127.0.0.1", "DBNAME": "testdb", "USERNAME": "testuser", "USERPWD":"test"}
}
],
"SUBSCRIBERS":[
{"NAME":"SubscriberApp1", "PARAMS":{"xyz":"abc"}},
]
}
Tools
Created with Nodeclipse (Eclipse Marketplace, site)
Nodeclipse is free open-source project that grows with your contributions.