Last active
April 2, 2023 19:44
-
-
Save nolanlawson/bddac54b92c2d8d39241 to your computer and use it in GitHub Desktop.
Creating a database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<pre id="display"></pre> | |
<script src="//cdn.jsdelivr.net/pouchdb/latest/pouchdb.min.js"></script> | |
<script src="index.js"></script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var db = new PouchDB('sample'); | |
db.info().then(function (info) { | |
document.getElementById('display').innerHTML = 'We have a database: ' + JSON.stringify(info); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I suggest
JSON.stringify(info, null, 2)
for prettier JSON look.And you can quickly launch a simple http web server to test the code using Node.js http-server package
Now access the page
http://localhost:8000