0.0.3 • Published 7 years ago
dumb_img v0.0.3
DumbImg Client
A dumb lib to interact with this dumb image storing server.
Example
import Client from './client';
// Only for dev, the lib will only be client.js
const cli = new Client('http://localhost:7654');
console.log(cli);
document.querySelector('#upload_test')
.addEventListener('submit', ev => {
ev.preventDefault();
const form = ev.target;
const file = form.querySelector('#file').files[0];
cli.upload(file)
.then(res => console.log(res))
.catch(
err => console.error(err)
);
});