feathersjs

How to add parameters to a FeathersJS socket connection

这一生的挚爱 提交于 2020-01-16 17:07:29
问题 I'm developing an app that uses a FeathersJS server, and an Electron app that uses FeathersJS Socket.io client to connect to the server. I'd like to use channels in the Electron app to get notified when some data in the server has changed. The Electron app is an "autonomuos" app, so there isn't any user authentication or interaction. The Electron app will have a unique id that represents each machine it is running on. Taking into account that there isn't any kind of authentication, how can I

TypeScript - Cannot import self in types override in other types root, TS7016

不羁的心 提交于 2020-01-14 16:39:51
问题 I am working with FeathersJS and TypeScript. As it is still under development (TS for Feathers) I found that I need to override types for that to be able to adjust to my case (e.g. pagination can be disabled or enabled and types should handle it but don't at the moment). In my tsconfig.json I have the following: "typeRoots": [ /* List of folders to include type definitions from. */ "./types", "node_modules/@types" ], The order does not matter as I have tried with node_modules first too. I put

TypeScript - Cannot import self in types override in other types root, TS7016

笑着哭i 提交于 2020-01-14 16:39:11
问题 I am working with FeathersJS and TypeScript. As it is still under development (TS for Feathers) I found that I need to override types for that to be able to adjust to my case (e.g. pagination can be disabled or enabled and types should handle it but don't at the moment). In my tsconfig.json I have the following: "typeRoots": [ /* List of folders to include type definitions from. */ "./types", "node_modules/@types" ], The order does not matter as I have tried with node_modules first too. I put

TypeScript - Cannot import self in types override in other types root, TS7016

北城以北 提交于 2020-01-14 16:38:00
问题 I am working with FeathersJS and TypeScript. As it is still under development (TS for Feathers) I found that I need to override types for that to be able to adjust to my case (e.g. pagination can be disabled or enabled and types should handle it but don't at the moment). In my tsconfig.json I have the following: "typeRoots": [ /* List of folders to include type definitions from. */ "./types", "node_modules/@types" ], The order does not matter as I have tried with node_modules first too. I put

How to make a vuejs application work with IE 11 when using feathersjs

南楼画角 提交于 2020-01-14 03:01:10
问题 When creating a standard vue app (using vue-cli v3.0) and including @feathersjs/feathers in order to implement a connection with a feathers API, I get an error with Internet Explorer 11 ( SCRIPT1010: Expected identifier ) The bottom line is to find an easy way to solve issues like this, because on bigger projects one could easily find lots of library issues and sometimes is necessary to support at least one version of Internet Explorer (at least from the business point of view) I read on

How JWT token expiresIn works in feathers?

左心房为你撑大大i 提交于 2020-01-10 06:07:20
问题 When I decode my JWT token I see in payload { "exp": 1494105589 } What does it value means? Docs says that default JWT expiresIn value is "1d" but it's not seems like 1 day after token created and even not 1 day in ms (1000*60*60*24). And the worst: this value not changed much when I set "expiresIn": "90d" in my config. Could somebody give some explanation of this? 回答1: it's a unix timestamp, counting the seconds since 1st of January 1970 00:00 UTC. There are several websites that help you to

Understanding FeathersJS hooks

最后都变了- 提交于 2020-01-06 23:46:10
问题 I'm following the tutorial. In Asynchronous hooks , there's a snippet like this: todoService.before({ find(hook) { return this.find().then(data => { hook.params.message = 'Ran through promise hook'; hook.data.result = data; // Always return the hook object return hook; }); } }); Would you please let me know what this.find() is supposed to do? 回答1: find is a Feathers service method and this is the service the hook is running on. 来源: https://stackoverflow.com/questions/37152839/understanding

feathers-authentication version 1 app.authenticate not working with sockets

↘锁芯ラ 提交于 2020-01-05 05:04:09
问题 I have setup feathersjs with ldap authentication, which requires feathers-authentication version 1. It works fine over rest using app.authenticate but it fails when using sockets. After enabling debugging, I confirmed that the server gets the credentials and successfully generates the token. The client, however, is not able to get the response. The server is emitting 'authentication created' which the client gets only when using socket.on('authentication created') not when using app

How to extend a Sequelize model?

假装没事ソ 提交于 2020-01-01 08:35:06
问题 Is there a way that I could use a base class that has all the common attributes and methods for my models but not linked with a database table, and then I could extend this base class when defining new models. Here I have created the base, person model in node express. I need the person class to be extended from the base class. const person = sequelizeClient.define('person', { name: { type: DataTypes.STRING, allowNull: false } }, { hooks: { beforeCount(options) { options.raw = true; } } });

How to create a async timeout error handler in feathers?

安稳与你 提交于 2019-12-25 01:13:07
问题 How do I create a async-function timeout error handler as a hook in feathers that resides in the service file to handle promises in hooks? Post created specifically as suggested by @Bergi on my previous question If you are looking to implement a generic async-function timeout (for promises failing to fulfill for whatever reason) as a featherjs hook, you might want to ask a new (different!) question about specifically that. I need a function that would be added to the database.hooks.js file