RData - Data Collection Instrument
Based on WebSockets, Json-RPC 2.0 and MongoDB
Warning
This software is currently in it's beta stage. The newest versions might (and most likely will) break the backwards compatibility.
Basic usage
var RDataServer = require('rdata-server');
var server = new RDataServer({
host: '0.0.0.0',
port: 8888,
dbUrl: 'mongodb://localhost:27017/data',
});
server.runServer();
RDataServer options:
- host - Server host
- Port - Server port
- dbUrl - Connection url of the MongoDB
- exposed - dictionary with exposed methods. Contains methodName and method. See: Extending the functionality
- exposedAnonymously - dictionary with anonymously exposed methods. See: Extending the functionality
- controllers - dictionary with custom controllers. See: Extending the functionality
- server - instance of websockets/ws WebSocket.Server. If not provided, it will be created during initialization with the options provided.
- location - location to use. If provided, only connections made at that location will be listened
The package includes standard server.js bootstrap script that you can use.
Wiki index:
Examples
For more examples, see test folder.