Created
November 25, 2017 01:26
-
-
Save Weffe/1f47ba39bf90f2db39a250d8045ff253 to your computer and use it in GitHub Desktop.
deepstream server as a Node process
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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