Skip to content

Buran/apic.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#REST API JavaScript Client Generator

##About Describe your REST API using WADL and get complete JavaScript client.

##Requirements

xsltproc

##Installation

npm install apic.js

##Usage Convert your WADL spec to javascript module

node /path/to/apic.js/bin/apic -w your.wadl -o descriptor.js

If you installed apic.js globally

apic -w your.wadl -o descriptor.js

Create your api module

var apic = require('apic'),
    descriptior = require('./descriptor');
	
return apic(descriptor);

Use it

var api = require('api');

api.users.get({ select: 50, omit: 100}, function(err, users) {
  console.log(users);
});
/*
GET http://{baseUri}/users?select=50&omit=100
*/

api.users.post({ name: 'John', age: 32 });
/*
POST http://{baseUri}/users
{ "name": "John", "age": 32 }
*/

About

REST API JavaScript client generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 84.2%
  • XSLT 15.8%