acebase/dist/browser.html
Ewout Stortenbeker c4f7ee9717 chore: browserify
2022-05-05 17:04:42 +02:00

22 lines
No EOL
660 B
HTML

<html>
<head>
<script src="browser.min.js"></script>
</head>
<body>
<script>
// Create AceBase using IndexedDB
const db = AceBase.WithIndexedDB('mydb');
db.ready(async () => {
console.log('Database ready to use');
const ref = await db.ref('browser').set({
test: 'AceBase runs in the browser!'
});
console.log(`"${ref.path}" was saved!`);
const snap = await ref.get();
console.log(`Got "${snap.ref.path}" value:`, snap.val());
})
</script>
</body>
</html>