feathersjs

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

房东的猫 提交于 2019-12-06 17:52:29
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 feathers site ( https://docs.feathersjs.com/api/client.html#module-loaders ) that the library uses ES6 so

Feathers Js Restrict Access To Page on Server Side

二次信任 提交于 2019-12-06 04:35:37
问题 I'm using feathers.js and am trying to restrict access to the payment-info.html page to users that are logged in. const app = feathers(); app.configure(configuration(path.join(__dirname, '..'))); app.use(compress()) .options('*', cors()) .use(cors()) .use(favicon( path.join(app.get('public'), 'favicon.ico') )) .use('/payment-info.html', function(req,res,next){ if(req.isAuthenticated()){ next(); } else { // 401 Not Authorized next(new Error(401)); } }) .use('/', serveStatic( app.get('public')

MobX + React Native : way to inject stores

自古美人都是妖i 提交于 2019-12-05 16:36:28
I'm trying to work with MobX for a new project. I started it on May 2017, and everything was working well. I had to stop, and now I go on developing it. I had to make an npm install to manage making it working, but now, I have some problem with stores... I rely on this tutorial for the structure : https://blog.callstack.io/write-react-native-apps-in-2017-style-with-mobx-e2dffc209fcb This is my structure : Main index.js import { Provider } from 'mobx-react'; import Stack from './router'; import stores from './stores'; export default class App extends Component { render() { return ( <Provider {.

How to query many to many relation in sequelize

我的梦境 提交于 2019-12-05 09:39:41
I've been using feathersjs/nodejs over postgres db via sequelize. In my db i have Users table and Events table. They are twice in relation: events.belongsTo(models.users, { foreignKey: { name: 'creatorId', allowNull: false }, onDelete: 'CASCADE', as: 'creator' }); events.belongsToMany(models.users, { through: 'event_participants', as: 'participants', foreignKey: 'eventId', otherKey: 'userId' }); models.users.belongsToMany(events, { through: 'event_participants', as: 'events' }); Everything works just fine, table is created and with include im getting users inside of event as participants.

Feathers.js / Sequelize -> Service with relations between two models

半城伤御伤魂 提交于 2019-12-05 05:49:45
I've got feathers.js functioning with mysql via sequelize. This is working, I can collect data from tables. Next step is to define 'joins' in the models. I have a table with a column 'status_id' and 'country_id'. These columns reference to an id in a metadata table. In SQL I would right: SELECT status.description, country.description, detail FROM details INNER JOIN metadata status ON (details.status_id = status.id AND status.type = 'status' INNER JOIN metadata country ON (details.country_id =country.id AND country.type = 'country') This metadata table won't be big in this case so hence this

How to extend a Sequelize model?

柔情痞子 提交于 2019-12-05 02:18:15
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; } } }); const base = sequelizeClient.define('base', { id: { type: Sequelize.INTEGER, autoIncrement: true,

Feathers Js Restrict Access To Page on Server Side

你离开我真会死。 提交于 2019-12-04 10:21:31
I'm using feathers.js and am trying to restrict access to the payment-info.html page to users that are logged in. const app = feathers(); app.configure(configuration(path.join(__dirname, '..'))); app.use(compress()) .options('*', cors()) .use(cors()) .use(favicon( path.join(app.get('public'), 'favicon.ico') )) .use('/payment-info.html', function(req,res,next){ if(req.isAuthenticated()){ next(); } else { // 401 Not Authorized next(new Error(401)); } }) .use('/', serveStatic( app.get('public') )) .use(bodyParser.json()) .use(bodyParser.urlencoded({ extended: true })) .configure(hooks())

Evaluating FeatherJS Authentication Needs

喜夏-厌秋 提交于 2019-12-02 05:04:18
问题 My collegues and I want to build a chat application (ReactJS <-> NodeJS), and we have been looking for the best framework to do so. FeathersJS seems undoubtedly the most stable and feature-rich socket.io wrapper. However, as we want to allow our application to scale up, we have decided to split this chat feature in a different node process than our main node backend. The chat functionalities still requires authentication and authorization however, and we would like to avoid duplicating

Evaluating FeatherJS Authentication Needs

只谈情不闲聊 提交于 2019-12-02 02:29:37
My collegues and I want to build a chat application (ReactJS <-> NodeJS), and we have been looking for the best framework to do so. FeathersJS seems undoubtedly the most stable and feature-rich socket.io wrapper. However, as we want to allow our application to scale up, we have decided to split this chat feature in a different node process than our main node backend. The chat functionalities still requires authentication and authorization however, and we would like to avoid duplicating authentication for the two services. Hence what we have come with as a solution is to query the main node

How to implement custom / complex operation routes in FeathersJS

巧了我就是萌 提交于 2019-12-01 21:26:33
问题 I need to implement a bunch of routes that do very custom / complex operations on a FeathersJS app. One of those routes is /Category/disableExclusiveContentsOf/:id . It runs a query against half a dozen database tables to find rows that relate to the category :id exclusively. I absolutely cannot do that using the querying abstractions FeathersJS provides. Then, it uses FeathersJS' "local" API to update the rows I found, so that data update events are fired to clients. However, if I implement