josx / ra-data-feathers

A feathers rest client for react-admin
MIT License
157 stars 53 forks source link

Does this work with feathers v3? [question] #51

Closed AndrewJDR closed 6 years ago

AndrewJDR commented 6 years ago

Does this work with feathers v3? Thanks.

josx commented 6 years ago

I havent tested with feathers v3, but would be very usefull to support it. It would be great if someone can test it and give us a feedback on that.

ricardovf commented 6 years ago

Here it worked.

import feathers from '@feathersjs/client'

const app = feathers()

app.configure(feathers.rest('http://localhost:3030').fetch(window.fetch));

const authService = feathers.authentication({
  storage: window.localStorage,
})
app.configure(authService)

export default app
import { authClient, restClient } from 'aor-feathers-client'
import feathersClient from './rest/feathersClient'

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

const App = () => (
  <Admin
    authClient={authClient(feathersClient, authClientOptions)}
    restClient={restClient(feathersClient, options)}
  >

    <Resource name="users" icon={UsersIcon} list={UsersList}/>
  </Admin>
)
josx commented 6 years ago

@ricardovf great!