0.0.15 • Published 8 years ago

miniswagger v0.0.15

Weekly downloads
1
License
ISC
Repository
github
Last release
8 years ago

miniswagger

Installation

npm install git+https://github.com/SelfishInc/miniswagger

or

npm install git+ssh://git@github.com:SelfishInc/miniswagger.git

Usage

Works through browserify

var miniswagger = require('miniswagger').default;

Fetching specs from remote server

ready promise is resolved once the API object is constructed:

var Api = new miniswagger.fromUrl('https://spec.selfishbeta.com/selfish/apis');

Api.ready.then(
    function() {
        Api.core.getStory({id: '0689a05650017f80'})
        .then(function(v) {console.log (v); });
    },

    function(error) {
        console.log(error);
    }
);

Using spec from JSON

This is synchronous:

var specs = require('./api-specs').default;
var miniswagger = require('miniswagger').default;
var Api = new miniswagger.fromSpecs(specs);

Api.core.getStory({id: '0689a05650017f80'}).then(
    function(story) {
        console.log(story);
    },
    function(error) {
        console.error(error);
    }
);
0.0.15

8 years ago

0.0.14

8 years ago

0.0.12

9 years ago

0.0.11

9 years ago

0.0.10

9 years ago

0.0.9

9 years ago

0.0.8

9 years ago

0.0.2

9 years ago

0.0.3

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago