Nonviolent Pigeon Manifestation

    bed-rest

    1.1.0 • Public • Published

    Bed

    A REST Client API Generator

    var bed = new Bed();
    bed.auth('bearer', 'token');
    bed.base('https://api.example.com');
    bed.type('application/json');
    bed.accept('application/vnd.github.v3+json');
    
    exports.listUsers = bed.get('/users').make();
    exports.getUser = bed.get('/users/<id>').make(); // <> = required, [] = optional
    exports.createUser = bed.post('/users').make();
    
    yield exports.listUsers();
    yield exports.getUser(); // throws argument error (missing "id")
    yield exports.createUser({});
    

    Install

    npm i bed-rest

    DownloadsWeekly Downloads

    7

    Version

    1.1.0

    License

    MIT

    Last publish

    Collaborators

    • slaskis