kahmali / meteor-restivus

REST APIs for the Best of Us! - A Meteor 0.9+ package for building REST APIs https://atmospherejs.com/nimble/restivus
MIT License
544 stars 117 forks source link

addRoute is not working #274

Closed pacozaa closed 7 years ago

pacozaa commented 7 years ago

I used this code.

if(Meteor.isServer) {

  let Api = new Restivus({
    useDefaultAuth: true,
    prettyJson: true
  });

  Api.addCollection(Sensordata);

  Api.addRoute('/node/:_id', {
    get: function () {
      console.log('Testing manual response');
      return true;
    }
  });
}

And get this error. There is no route for the path: /api/node from kadira flow-router but api/sensordata works fine.

pacozaa commented 7 years ago

Ok i got it. Don't use / in front of addRoute argument


if(Meteor.isServer) {

  let Api = new Restivus({
    useDefaultAuth: true,
    prettyJson: true
  });

  Api.addCollection(Sensordata);

  Api.addRoute('node/:_id', {
    get: function () {
      console.log('Testing manual response');
      return true;
    }
  });
}