Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
freezeTableName: true
});
// Initialize PubNub client
var pubnub = new pubnub({
ssl: true,
subscribe_key: 'sub-c-4377ab04-f100-11e3-bffd-02ee2ddab7fe'
});
// Subscribe (listen on) to channel
pubnub.subscribe({
channels: ['pubnub-market-orders']
});
// Handle message payload
pubnub.addListener({
message: function (message) {
console.log(message.message);
connection.sync({
//logging: ()=>{}
})
.then(function () {
// Build and Save message stream to database
var orderInstance = order.build({
order_time: message.message.timestamp,
trade_type: message.message.trade_type,
symbol: message.message.symbol,
order_quantity: message.message.order_quantity,
bid_price: message.message.bid_price
})
//orderInstance.save()
//if (Math.random() > .9) {