mirror of
https://github.com/appy-one/acebase-client.git
synced 2026-05-25 14:12:15 -06:00
29 lines
No EOL
974 B
HTML
29 lines
No EOL
974 B
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> |