vendredi 27 février 2015

firebase setup-instructions for windows?

I want to get started with firebase on a Windows machine but I don't understand the getting started instructions on http://ift.tt/1t3uTRX.


I created a .html file with the following content (copied from the instruction on that page). That works, info is added to the database and retrieved from the database. However I'm lost on Linux like instructions like $ npm install -g firebase-tools on that page.


I installed nodejs following the link to nodejs.org on http://ift.tt/1wP6Fdu


If I execute the above command (without the linux $-prompt) in the node.js screen I get the following error message npm should be run outside of the node repl, in your normal shell. (Press Control-D to exit.)


So then what?





<html>
<head>
<script src="http://ift.tt/185z2Pa"></script>
</head>
<body>
<script>
var myFirebaseRef = new Firebase("http://ift.tt/1G0DgXk");
myFirebaseRef.set({
title: "Hello!",
author: "Firebase",
location: {
city: "San Francisco",
state: "California",
zip: 94103
}
});
myFirebaseRef.child("location/city").on("value", function(snapshot) {
alert(snapshot.val()); // Alerts "San Francisco"
});
</script>
</body>
</html>



Aucun commentaire:

Enregistrer un commentaire