Skip to content
This repository has been archived by the owner on Apr 17, 2022. It is now read-only.

Commit

Permalink
updating dist
Browse files Browse the repository at this point in the history
  • Loading branch information
jgermade committed Feb 19, 2018
1 parent edf4369 commit 19ce392
Show file tree
Hide file tree
Showing 11 changed files with 2,544 additions and 0 deletions.
21 changes: 21 additions & 0 deletions dist/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) Jesús Manuel Germade Castiñeiras <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
81 changes: 81 additions & 0 deletions dist/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@

# http-rest

`ajax / http` wrapper for browser and node that allows config inheritance ( uses [fetch API](https://developer.mozilla.org/es/docs/Web/API/Fetch_API) when present )

[![npm](https://img.shields.io/npm/v/http-rest.svg)](https://www.npmjs.com/package/http-rest) [![bower](https://img.shields.io/bower/v/http-rest.svg)](http://bower.io/search/?q=http-rest)
[![Build Status](https://travis-ci.org/kiltjs/http-rest.svg?branch=master)](https://travis-ci.org/kiltjs/http-rest)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

### Installation

> Node module
``` sh
npm install http-rest --save
```
``` js
var $http = require('http-rest');
```

> Browser using node bundler
``` js
var $http = require('http-rest/browser');

// if you want to use fetch API when present
var $http = require('http-rest/fetch');
```

> Browser using bower
``` sh
bower install http-rest --save
```

``` js
// if you want to use fetch API when present (in bower.json)
// ...
"overrides": {
"http-rest": {
"main": "dist/fetch.js"
}
},
// ...
```


### Usage

``` js
// GET .../items?prop1=value1
$http.get('/items', { params: { prop1: value1 } });

$http.post('/items', {
sample: 'payload'
});

$http.put('/items/:itemId', {
sample: 'payload'
});

$http.patch('/items/:itemId', {
sample: 'payload'
});

$http.delete('/items/:itemId');
```

### Base configurations

``` js
var httpItems = $http.base('items');

httpItems.post({ prop1: 'value1' });

httpItems.get(itemId);

httpItems.put(itemId, { prop1: 'another value' });

httpItems.delete(itemId);
```
Loading

0 comments on commit 19ce392

Please sign in to comment.