0.4.1 • Published 8 years ago
trepo-client v0.4.1
trepo-client-js
A Client that abstracts the routing between various Trepo Servers.
Example
import Client from './some/where/Client.js';
let worker; // A web worker for https://repo1.example.com
let trepo; // A local trepo for https://repo2.example.com
let client = new Client();
client.addWorkerRoute('https://repo1.example.com', worker);
client.addLocalRoute('https://repo2.example.com', trepo);
client.request({
repo: 'https://repo1.example.com'
})
.then(response => {
// Do something here.
})
.catch(error => {
// Something bad happened.
// error Looks like {code: 4xx, msg: 'whoopsie'}
})