Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cliu no requires rest calls to add v1 themselves

  • Loading branch information...
commit e7ce58c17c3cf29db66b3c75550e5c0e65d1cd62 1 parent 74b1038
@soldair soldair authored
Showing with 6 additions and 6 deletions.
  1. +4 −4 index.js
  2. +1 −1  lib/commands/provision.js
  3. +1 −1  lib/commands/who.js
View
8 index.js
@@ -18,7 +18,7 @@ module.exports = function(config){
var api = {
session:config.session||{},
login:function(email,password,cb){
- this.rest('post','/login',{email:email,password:password},function(err,data){
+ this.rest('post','/v1/login',{email:email,password:password},function(err,data){
if(err) return cb(err);
this.session = data;
cb(false,data);
@@ -29,14 +29,14 @@ module.exports = function(config){
cb(false,false);
})
- this.rest('post','/logout',function(err,data){
+ this.rest('post','/v1/logout',function(err,data){
this.session = config.session = {};
cb(err,data);
})
},
register:function(data,cb){
// you should send email,password, firstname, lastname, username
- this.rest('post','/register',data,function(err,data){
+ this.rest('post','/v1/register',data,function(err,data){
if(err) return cb(err);
this.session = data;
cb(false,data);
@@ -51,7 +51,7 @@ module.exports = function(config){
data = {};
}
- var uri = (config.api||'https://api.pinocc.io')+path.join('/v1',''+uri);
+ var uri = (config.api||'https://api.pinocc.io')+path.join('/',''+uri);
var data = data||{};
if(this.session.token) data.token = this.session.token;
View
2  lib/commands/provision.js
@@ -20,7 +20,7 @@ function getTroopsAndDevices(cb){
}
, c = 0;
- api.rest('get','/troops',function(err,data){
+ api.rest('get','/v1/troops',function(err,data){
troops = data;
done(err);
});
View
2  lib/commands/who.js
@@ -1,7 +1,7 @@
module.exports = function(args,api,config,next){
if (config.token) {
- api.rest('get','/account',function(err,data){
+ api.rest('get','/v1/account',function(err,data){
if(err){
console.log('not logged in, but you used to be.');
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.