项目作者: feathersjs-ecosystem

项目描述 :
[MOVED] REST client services for different Ajax libraries
高级语言: JavaScript
项目地址: git://github.com/feathersjs-ecosystem/rest-client.git
创建时间: 2017-07-15T21:52:30Z
项目社区:https://github.com/feathersjs-ecosystem/rest-client

开源协议:MIT License

下载


@feathersjs/rest-client

Important: The code for this module has been moved into the main Feathers repository at feathersjs/feathers (package direct link). Please open issues and pull requests there. No changes in your existing Feathers applications are necessary.

Build Status

REST client services for different Ajax libraries

@feathersjs/rest-client supports REST server connectivity using jQuery, request, Superagent, Axios, Fetch or Angular HTTP as the AJAX library.

Installation

  1. npm install @feathersjs/rest-client --save

Quick example

  1. const feathers = require('@feathersjs/feathers');
  2. const rest = require('@feathersjs/rest-client');
  3. const app = feathers();
  4. // Connect to the same as the browser URL (only in the browser)
  5. const restClient = rest();
  6. // Connect to a different URL
  7. const restClient = rest('http://feathers-api.com')
  8. // Configure an AJAX library (see below) with that client
  9. app.configure(restClient.fetch(window.fetch));
  10. // Connect to the `http://feathers-api.com/messages` service
  11. const messages = app.service('messages');

Documentation

Please refer to the @feathersjs/rest-client documentation for more details.

License

Copyright (c) 2018

Licensed under the MIT license.