acebase-client
Version:
Client to connect to an AceBase realtime database server
29 lines • 1 kB
HTML
<html>
<head>
<script src="browser.js"></script>
</head>
<body>
<script>
// Test connecting to an AceBase server running on localhost port 3291,
// using specific admin credentials
const db = new AceBaseClient('localhost', 3291, 'server', false);
db.ready(() => {
console.log('Database ready to use');
db.signIn('admin', 'p@5sw0rd')
.then(() => {
return db.ref('browser').set({
test: 'Browser test!'
});
})
.then(ref => {
console.log(`"${ref.path}" was saved!`);
return ref.get();
})
.then(snap => {
console.log(`Got "${snap.ref.path}" value:`);
console.log(snap.val());
})
})
</script>
</body>
</html>