js-data-http 3.0.0-alpha.9

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