backandsdk
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -20,6 +20,5 @@ /* | ||
const serverUrl = 'https://api.backand.com'; | ||
var BackandSdk = function () { | ||
var BackandSdk = function (serverUrl) { | ||
this.serverUrl = serverUrl || 'https://api.backand.com'; | ||
this.userData = {}; | ||
@@ -53,3 +52,3 @@ this.header = {}; | ||
{ | ||
url: serverUrl + '/token', | ||
url: backand.serverUrl + '/token', | ||
method: "POST", | ||
@@ -88,3 +87,2 @@ form: { | ||
BackandSdk.prototype.getUserData = function () { | ||
@@ -94,3 +92,2 @@ return this.userData; | ||
BackandSdk.prototype.get = function (uri, data, filter) { | ||
@@ -102,3 +99,3 @@ var backand = this; | ||
function getUrl(uri, haveData, data) { | ||
var res = serverUrl + uri + (haveData ? data : '') | ||
var res = backand.serverUrl + uri + (haveData ? data : '') | ||
//console.log(res); | ||
@@ -147,3 +144,3 @@ return res; | ||
method: 'POST', | ||
url: serverUrl + uri + ret, | ||
url: backand.serverUrl + uri + ret, | ||
json: json, | ||
@@ -168,3 +165,3 @@ headers: backand.getHeader() | ||
method: 'PUT', | ||
url: serverUrl + uri, | ||
url: backand.serverUrl + uri, | ||
json: json, | ||
@@ -171,0 +168,0 @@ headers: backand.getHeader() |
{ | ||
"name": "backandsdk", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "Backand sdk for node.js", | ||
@@ -5,0 +5,0 @@ "author": "Ygal Bellaiche", |
@@ -13,5 +13,5 @@ # Node.Js sdk for [Backand](www.backand.com) | ||
var BackandSdk = require("backandsdk/backand"); | ||
var backand = new BackandSdk(); | ||
var backand = require("backandsdk/backand"); | ||
// anonymous authetication | ||
@@ -18,0 +18,0 @@ backand.anoymousAuth('08fd510a-4b52-43fa-938f-f2c841bd3106') |
@@ -5,4 +5,5 @@ /** | ||
var backand = require("./../backand"); | ||
var BackandSdk = require("./../backand"); | ||
var backand = new BackandSdk(); | ||
describe('authorization work', function () { | ||
@@ -9,0 +10,0 @@ this.timeout(60000); |
@@ -5,3 +5,4 @@ /** | ||
var backand = require("./../backand"); | ||
var BackandSdk = require("./../backand"); | ||
var backand = new BackandSdk(); | ||
var assert = require("assert"); | ||
@@ -8,0 +9,0 @@ |
@@ -5,3 +5,4 @@ /** | ||
var backand = require("./../backand"); | ||
var BackandSdk = require("./../backand"); | ||
var backand = new BackandSdk(); | ||
var assert = require("assert"); | ||
@@ -8,0 +9,0 @@ |
@@ -7,3 +7,4 @@ /** | ||
var backand = require("./../backand"); | ||
var BackandSdk = require("./../backand"); | ||
var backand = new BackandSdk(); | ||
var assert = require("assert"); | ||
@@ -10,0 +11,0 @@ |
17624
13
536