Comparing version 0.0.1 to 0.0.2
var request = require('request'); | ||
var querystring = require('querystring'); | ||
var apiBaseUrl = 'https://api.singly.com'; | ||
var apiBaseUrl = process.env.SINGLY_API_HOST || 'https://api.singly.com'; | ||
var API_VERSION = 0; | ||
@@ -6,0 +6,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"description": "Client library for the Singly API", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"homepage": "http://dev.singly.com", | ||
@@ -8,0 +8,0 @@ "main" : "lib.js", |
13
test.js
@@ -36,3 +36,3 @@ var Singly = require('./lib'); | ||
qs.access_token = accessToken; | ||
singly.post('/types/statuses', {qs:req.query}, function(err, resp, body) { | ||
singly.post('/types/statuses', {qs:qs}, function(err, resp, body) { | ||
if (err) return res.send(err, 500); | ||
@@ -43,3 +43,14 @@ res.send(body); | ||
app.post('/link', function(req, res) { | ||
if (!accessToken) return res.send('must auth at http://localhost:8044/', 401); | ||
var qs = req.query; | ||
qs.access_token = accessToken; | ||
singly.post('/types/links', {qs:qs}, function(err, resp, body) { | ||
if (err) return res.send(err, 500); | ||
res.send(body); | ||
}); | ||
}); | ||
app.listen(8044); | ||
console.log('open http://localhost:8044'); |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
4363
112
2