Coder Social home page Coder Social logo

aor-feathers-client's Introduction

Feathers REST Client for Admin-on-rest

The perfect match to build Backend and Frontend Admin, based on REST services. For using feathers with admin-on-rest.

Features

  • GET_MANY
  • GET_LIST
  • GET_ONE
  • CREATE
  • UPDATE
  • DELETE
  • AUTH_LOGIN
  • AUTH_LOGOUT
  • AUTH_CHECK
  • AUTH_ERROR
  • Custom Id support

Installation

In your admin-on-rest app just add aor-feathers-client dependency:

npm install aor-feathers-client --save

or

yarn add aor-feathers-client

Running tests

npm run test

Example with Feathersjs stable (AUK)

// in src/feathersClient.js
import feathers from 'feathers-client';

const host = 'http://localhost:3030';

export default feathers()
    .configure(feathers.hooks())
    .configure(feathers.rest(host).fetch(window.fetch.bind(window)))
    .configure(feathers.authentication({ jwtStrategy: 'jwt', storage: window.localStorage }));
// in src/App.js
import React from 'react';
import { Admin, Resource } from 'admin-on-rest';
import { authClient, restClient } from 'aor-feathers-client';
import feathersClient from './feathersClient';
import { PostList } from './posts';

const authClientOptions = {
  storageKey: 'feathers-jwt',
  authenticate: { strategy: 'local' },
};

// to rename id field for *all* resources use this syntax:
const options = { id: '_id' };

// to rename id field(s) for specific resources use this syntax:
const options = {'my-resource': {id: '_id'}}

const App = () => (
  <Admin
    authClient={authClient(feathersClient, authClientOptions)}
    restClient={restClient(feathersClient, options)}
  >
    <Resource name="posts" list={PostList} />
  </Admin>
);

export default App;

License

This software is licensed under the MIT Licence, and sponsored by Cambá.

aor-feathers-client's People

Contributors

josx avatar amrn avatar fonzarely avatar tony-kerz avatar dreamrace avatar wedneyyuri avatar 7flash avatar tb avatar ryanthegiantlion avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.