Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Mar 18, 2019. It is now read-only.

core-api/javascript-client

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

171 Commits
171 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Javascript client library

Javascript client library for Core API.

travis-image npm-image codecov-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.

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

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

    client.get("http://httpbin.org/")
      .then(function (data) {
        var responseElement = 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
const coreapi = require('coreapi');

const client = new coreapi.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

 
 
 

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.