8000 GitHub - jpadilla/javascript-client: Javascript client library for Core API.
[go: up one dir, main page]

Skip to content

jpadilla/javascript-client

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Javascript client library

Javascript client library for Core API.

build-status-image npm-version

In progress.

Usage

Browser

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

<script src="https://unpkg.com/coreapi@latest/dist/coreapi.js"></script>

<script type="text/javascript">
    var coreapi = window.coreapi;
    var client = coreapi.client();

    client.get("http://httpbin.org/")
      .then(function (response) {
        var responseElement = document.getElementById("response");
        responseElement.innerText = response;
      })
      .catch(function (error) {
        console.log("ERROR: ", error);
      });
</script>
Node

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

$ npm install coreapi
import coreapi from 'coreapi';

const client = coreapi.client();

client.get("http://httpbin.org/")
  .then((statusText) => {
    console.log("Status: ", statusText);
  })
  .catch((error) => {
    console.log("Error: ", error);
  });

About

Javascript client library for Core API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 78.6%
  • HTML 21.4%
0