npm.io
1.17.12 • Published 5 months ago

@blocklet/server-js

Licence
Apache-2.0
Version
1.17.12
Deps
12
Size
6.0 MB
Vulns
0
Weekly
0
Stars
4

ABT Node Client

Client library to connect webapp to Abt Node Daemon

Table of Contents

Development

upgrade code: you need two shells

  1. start demo server
cd ../gql
node demo.js
  1. upgrade code
npm run upgrade

Install

npm i @blocklet/server-js -S
# OR
yarn add @blocklet/server-js

Usage

const AbtNodeClient = require('@blocklet/server-js');

const client = new AbtNodeClient('http://localhost:3030/api/gql');
console.log({
  queries: client.getQueries(),
  subscriptions: client.getSubscriptions(),
  mutations: client.getMutations(),
});

client.listBlocklets().then(console.log);

Debugging

  • If you are in Node.js: DEBUG=@blocklet/server-js node script.js
  • If you are in Browser: localStorage.setItem('DEBUG', '@blocklet/server-js')

Documentation

Query arguments and response structure can be found: QUERIES.md

Keywords