Skip to content

ancyrweb/javascript-client

Repository files navigation

Javascript client library

Javascript client library for Core API.

travis-imagenpm-imagecodecov-image

In progress.

Usage

Browser

The core js library is available on the unpkg cdn. Once loaded the library will be available on window.coreapi.

<scriptsrc="https://unpkg.com/coreapi@latest/dist/coreapi.js"></script><scripttype="text/javascript">varcoreapi=window.coreapi;varclient=newcoreapi.Client();client.get("http://httpbin.org/").then(function(data){varresponseElement=document.getElementById("response");responseElement.innerText=data;}).catch(function(error){console.log("ERROR: ",error);});</script>
Node

Install it with NPM or add it to your package.json:

$ npm install coreapi 
constcoreapi=require('coreapi');constclient=newcoreapi.Client()client.get("http://httpbin.org/").then((data)=>{console.log("Status: ",data);}).catch((error)=>{console.log("Error: ",error);});

Tests

To run the tests (linting & unit tests):

npm test 

About

Javascript client library for Core API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript97.4%
  • HTML2.6%