@hookcompany/feathers-client-custom-methods
Version:
️🏹 Create feathers service on client with custom methods names.
28 lines (23 loc) • 641 B
JavaScript
import feathers from '@feathersjs/feathers';
import feathersRestClient from '@feathersjs/rest-client';
import axios from 'axios';
import feathersCustomMethods from '../dist';
const HTTP_URI = 'http://192.168.100.6:4000/mobile';
const rest = feathers()
.configure(feathersRestClient(HTTP_URI).axios(axios))
.configure(feathersCustomMethods());
const Feeds = rest.service('feeds', [
'foo:find',
'bar:get',
'barbar:get',
'buzz:create',
'helloworld:create',
'foobar:patch',
'foobuzz:update',
'foobuzzbar:update',
'foobuzzbarfoo:update',
'foobarbuzz:remove'
]);
Feeds.foo()
.then(console.log)
.catch(console.log);