3.0.0 • Published 9 months ago

torrust-index-api-lib v3.0.0

Weekly downloads
-
License
SEE LICENSE IN CO...
Repository
github
Last release
9 months ago

Torrust Index Application Interface

Test

A simple TypeScript/ES6 library that contains API calls used by the Torrust Index project.

Install

You can install this library using NPM:

npm i -S torrust-index-api-lib torrust-index-types-lib

Then import either the Rest or GraphQL (WIP) API library:

Rest

import {rest} from "torrust-index-api-lib";

GraphQL

import {graphql} from "torrust-index-api-lib";

Usage (Rest)

Torrent

Example of retrieving a single torrent using its torrent_id:

import {rest} from "torrust-index-api-lib";
import {Torrent} from "torrust-index-types-lib";

const API_BASE_URL = "http://localhost:3000";
let torrentId = 1;

rest.torrent.getTorrent(API_BASE_URL, torrentId)
    .then((torrent) => {
        // torrent has type Torrent
        console.log(torrent);
    })
    .catch((err) => {
        console.error(err);
    });

Usage (GraphQL)

The GraphQL API still needs to be developed.

3.0.0-beta.2

9 months ago

3.0.0-rc.1

9 months ago

3.0.0

9 months ago

3.0.0-beta

9 months ago

1.0.0-alpha.7

1 year ago

3.0.0-alpha.1

1 year ago

3.0.0-alpha.12

10 months ago

1.0.0-alpha.6

1 year ago

1.0.0-alpha.5

1 year ago

1.0.0-alpha.4

2 years ago

1.0.0-alpha.3

2 years ago

0.1.13

2 years ago

0.1.14

2 years ago

0.1.15

2 years ago

0.2.0

2 years ago

1.0.0-alpha.1

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago