Comparing version 0.1.1 to 0.1.2
@@ -24,3 +24,3 @@ var ExceptionLogger = require('./lib/exception-logger'), | ||
// so that all our calls to conman.send() use the correctly configured instance | ||
conman.init({setDefault: true, apiKey: apiKey}); | ||
conman.init({setDefault: true, apiKey: apiKey, useProxy: false}); | ||
@@ -27,0 +27,0 @@ conman.on('open', function(){ console.log("open");}); |
@@ -1,1 +0,48 @@ | ||
module.exports = function(){}; | ||
var util = require('util'), | ||
https = require('https'), | ||
BaseProvider = require('./base-provider').BaseProvider; | ||
function RestfulProvider(endpoint, apiKey) { | ||
this._endpoint = endpoint; | ||
this._apiKey = apiKey; | ||
var self = this; | ||
setTimeout(function() { | ||
self.emit("open"); | ||
self.emit("authorized"); | ||
}, 1000); | ||
} | ||
util.inherits(RestfulProvider, BaseProvider); | ||
// write json data to underlying websocket | ||
RestfulProvider.prototype.write = function(jsonData) { | ||
var self = this; | ||
// todo use this._endpoint | ||
var options = { | ||
hostname: 'api.arewegood.io', | ||
port: 443, | ||
path: '/logs?access_token=' + self._apiKey, | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
'Content-Length': jsonData.length | ||
} | ||
}; | ||
var req = https.request(options, function(res) { | ||
self.emit('error', res.statusCode); | ||
}); | ||
req.on('error', function(e) { | ||
self.emit('error', e.message); | ||
}); | ||
// write data to request body | ||
req.write(jsonData); | ||
req.end(); | ||
}; | ||
module.exports = RestfulProvider; |
{ | ||
"name": "arewegood", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16767
400
1