Skip to content
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.

feathers rest client call get but server execute find #237

Closed
oussamaABID opened this issue Jan 11, 2018 · 1 comment
Closed

feathers rest client call get but server execute find #237

oussamaABID opened this issue Jan 11, 2018 · 1 comment

Comments

@oussamaABID
Copy link

oussamaABID commented Jan 11, 2018

hi
i update my server app befor =>from Auk to buzzard

Steps to reproduce my Bug

When i try this configure

     this._socket = io(environment.url, { timeout: this.DEFAULT_TIME_OUT });
     this._feathers = feathers();
     this._rest = feathersRest(environment.url).axios(axios);
     this._feathers.configure(socketio(this._socket, { timeout: this.DEFAULT_TIME_OUT }));
     // this._feathers.configure(this._rest);

and call endPoint with this:

this._rest.service('middlewareApp').get('1'); // =>  _rest call 'find' not 'get' function

this is my middlewar code

const app = this; // eslint-disable-line no-unused-vars
  app.use('middlewareApp/:myId', {
    get(id, params) {
      return Promise.resolve({
        params
      });
    },
    find(query, params) {
      return Promise.resolve({
        params
      });
    }
  });
};

Version Client:

"dependencies": {
    "@angular/common": "4.4.4",
    "@angular/compiler": "4.4.4",
    "@angular/core": "4.4.4",
    "@angular/http": "4.4.4",
    "axios": "0.16.2",
    "feathers-authentication": "1.2.7",
    "feathers-authentication-client": "0.3.3",
    "feathers-authentication-management": "1.0.2",
    "feathers-client": "2.4.0",
    "feathers-reactive": "0.5.2"
    "zone.js": "0.8.14"
  },

Version Server:

"dependencies": {
 "@feathersjs/authentication": "2.1.1",
    "@feathersjs/authentication-jwt": "1.0.2",
    "@feathersjs/authentication-local": "1.0.4",
    "@feathersjs/authentication-oauth1": "1.0.3",
    "@feathersjs/authentication-oauth2": "1.0.3",
    "@feathersjs/configuration": "1.0.2",
    "@feathersjs/errors": "3.2.0",
    "@feathersjs/express": "1.1.2",
    "@feathersjs/feathers": "3.0.5",
    "@feathersjs/socketio": "3.0.2",
    "@google/maps": "0.4.3",
    "abstract-blob-store": "3.2.0",
    "body-parser": "1.18.1",
    "compression": "1.7.0",
    "cors": "2.8.4",
    "feathers-authentication-hooks": "0.1.4",
    "feathers-authentication-management": "1.0.2",
    "feathers-blob": "1.3.1",
    "feathers-hooks-common": "3.7.2",
    "feathers-mailer": "2.0.0",
    "feathers-mongodb": "2.9.0",
    "feathers-mongoose": "6.0.0",
  },
@oussamaABID oussamaABID changed the title feathers rest client call get but server excute find feathers rest client call get but server execute find Jan 11, 2018
@daffl
Copy link
Member

daffl commented Jan 11, 2018

As the documentation says:

A client application can only use a single transport (either REST, Socket.io or Primus). Using two transports in the same client application is normally not necessary.

If you want real-time updates you have to establish a websocket connection already so you might as well use the faster way to call service methods via websockets as well.

I also recommend to upgrade the versions on the client according to the migration guide.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants