JSPM

  • Created
  • Published
  • Downloads 2186
  • Score
    100M100P100Q103921F
  • License MIT

HTTP (XHR) adapter for js-data in the browser.

Package Exports

  • js-data-http

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (js-data-http) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

js-data logo

js-data-http

Slack Status npm version Circle CI npm downloads Coverage Status Codacy

This repo contains HTTP adapters for js-data:

  • js-data-http - HTTP (XHR, includes [axios][axios]) adapter for js-data in the browser. Capable of using window.fetch instead of axios.
  • js-data-fetch - Same as js-data-http but doesn't include axios and will use window.fetch if available and if you don't provide your own http library.
  • js-data-http-node - Same as js-data-http but runs on Node.js. Depends on axios and will use axios unless you provide a different http library.

Tested on IE9, Chrome 46, Firefox 41 & Safari 7.1 using bs logo

To get started, visit http://js-data.io.

Table of contents

Quick Start

npm install --save js-data js-data-http or bower install --save js-data js-data-http.

npm install --save axios js-data js-data-http-node

ES6

// Doesn't make much sense to use DataStore on the server
import {Container} from 'js-data'
import HttpAdapter from 'js-data-http-node'

const adapter = new HttpAdapter()
const container = new Container()

container.registerAdapter('http', adapter, { default: true })

container.defineMapper('school')
container.defineMapper('student')

container.find('school', 1).then(function (school) {
  // ...
})

Dependencies

js-data-http bundles axios and depends on js-data. js-data-fetch depends on js-data. js-data-http-node depends on js-data and optionally axios.

See JSData's dependencies.

Guides and Tutorials

Get started at http://js-data.io

API Reference Docs

Visit http://api.js-data.io.

Community

Explore the Community.

Support

Find out how to Get Support.

Contributing

Read the Contributing Guide.

License

The MIT License (MIT)

Copyright (c) 2014-2016 js-data-http project authors