Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
all: [(context) => {
const {opts} = context.result;
if (typeof opts === 'object' &&
opts._t === '/m/') {
evbus.trigger('update:' + opts._id, context.result.data);
}
return Promise.resolve(context);
}],
},
};
const endpoint = process.settings.origin;
const ws = io(endpoint);
const rest = feathers.rest(endpoint);
const app = feathers();
const wsc = feathers();
app.configure(rest.axios(axios));
wsc.configure(socketio(ws, {
timeout: 2000,
}));
wsc.hooks(hooks);
app.hooks(hooks);
app.io = wsc;
app.ws = ws;
export default app;
}
if (request) {
hooks = {
before: {
all: [(ctx) => {
ctx.params.accessToken = request.cookies [COOKIE_NAME]
}]
}
}
}
const endpoint = (isClient ? location.origin : process.env.ORIGIN) || 'http://localhost:6767'
const rest = feathers.rest(endpoint)
const app = feathers()
app.configure(rest.axios(axios))
app.configure(auth(authOptions))
app.hooks(hooks)
if (isClient && WEBSOCKETS) {
const wsc = feathers()
const ws = io(endpoint)
wsc.configure(auth(authOptions))
wsc.configure(socketio(ws, {
timeout: 2000,
}))
wsc.hooks(hooks)
app.io = wsc
const endpoint = 'http://localhost:8000';
const app = feathers()
if (typeof window !== 'undefined') {
const ws = io(endpoint)
const wsc = feathers()
wsc.configure(socketio(ws, {
timeout: 2000,
}));
wsc.hooks(hooks)
app.io = wsc
app.ws = ws
}
const rest = feathers.rest(endpoint)
app.configure(rest.axios(axios))
app.hooks(hooks)
export default app