How to use the nats.DEFAULT_URI function in nats

To help you get started, we’ve selected a few nats examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fanyang01 / crawler / electron / client / main.js View on Github external
const util = require('util');
const fs = require('fs');
const Websocket = require('ws');
const NATS = require('nats');
const electron = require('electron');
const app = electron.app; // Module to control application life.
const ipcMain = electron.ipcMain;
const BrowserWindow = electron.BrowserWindow; // Module to create native browser window.


function Emitter() {
  EventEmitter.call(this);
}
util.inherits(Emitter, EventEmitter);

const natsURL = process.env.NATS_URL || NATS.DEFAULT_URI;
const websocketURL = process.env.WEBSOCKET_URL || 'ws://localhost:8162';
const connMode = process.env.CONN_MODE || '';

var ws = null;
var nats = null;
var clientID = null;
// windows = [],
// working = [];

// Quit when all windows are closed.
app.on('window-all-closed', function() {
  // if (process.platform != 'darwin') {
  //   app.quit();
  // }
});

nats

Node.js client for NATS, a lightweight, high-performance cloud native messaging system

Apache-2.0
Latest version published 1 day ago

Package Health Score

86 / 100
Full package analysis