Syncing with NexusDB Cloud Engine...
Syncing with NexusDB Cloud Engine...
Enter 4-digit PIN to open
Zero-Config Custom Web API & SDK Engine
// --- NexusDB Lightweight JS Client ---
window.NexusDB = function(endpoint = 'https://cloud-db-studio-default-rtdb.firebaseio.com') {
const base = endpoint.replace(/\/$/, '');
return {
async get(path = '') {
const res = await fetch(`${base}/${path}.json`);
return res.json();
},
async set(path, data) {
const res = await fetch(`${base}/${path}.json`, {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
});
return res.json();
},
async push(path, data) {
const res = await fetch(`${base}/${path}.json`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
});
return res.json();
},
async delete(path) {
const res = await fetch(`${base}/${path}.json`, { method: 'DELETE' });
return res.json();
}
};
};
const db = NexusDB();
// 1. Fetch data
const users = await db.get('users');
// 2. Save data
await db.set('users/alex', { email: 'alex@example.com', score: 98 });
// 3. Append to list
await db.push('logs', { event: 'Login', time: Date.now() });
// 4. Delete item
await db.delete('users/alex');
Click 'Send' above to test live endpoint.
Confirm action