UNPKG

helix-ts

Version:

TypeScript Library for working with HelixDB

23 lines (22 loc) 581 B
class HelixDB { /** * Create a new HelixDB client * @param url - The url of the HelixDB server * * (default: `https://localhost:6969`) */ constructor(url = "https://localhost:6969") { this.url = url; } async query(endpoint, data) { const response = await fetch(`${this.url}/${endpoint}`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify(data), }); return response.json(); } } export default HelixDB;