mirror of
https://github.com/appy-one/acebase.git
synced 2026-05-25 22:01:21 -06:00
25 lines
No EOL
850 B
HTML
25 lines
No EOL
850 B
HTML
<html>
|
|
<head>
|
|
<script src="browser.min.js"></script>
|
|
</head>
|
|
<body>
|
|
<script>
|
|
// Create AceBase using localStorage
|
|
const db = new AceBase('mydb', { temp: false }); // Set temp to true to use sessionStorage instead of localStorage
|
|
db.ready(() => {
|
|
console.log('Database ready to use');
|
|
return db.ref('browser').set({
|
|
test: 'AceBase runs in the browser!'
|
|
})
|
|
.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> |