Skip to content

Instantly share code, notes, and snippets.

@Weffe
Created November 25, 2017 01:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Weffe/1f47ba39bf90f2db39a250d8045ff253 to your computer and use it in GitHub Desktop.
Save Weffe/1f47ba39bf90f2db39a250d8045ff253 to your computer and use it in GitHub Desktop.
deepstream server as a Node process
const DeepstreamServer = require('deepstream.io');
const MongoDBStorageConnector = require('deepstream.io-storage-mongodb');
const C = DeepstreamServer.constants;
/*
The server can take
1) a configuration file path
2) null to explicitly use defaults to be overriden by server.set()
3) left empty to load the base configuration from the config file located within the conf directory.
4) pass some options, missing options will be merged with the base configuration
*/
const server = new DeepstreamServer('./ds-rover-config.yml');
server.set('storage', new MongoDBStorageConnector({
connectionString: 'mongodb://127.0.0.1:27017/deepstream',
defaultCollection: 'deepstream_records',
splitChar: '/'
}));
// start the server
server.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment