09 June 2016
A few weeks ago, after Google I/O, we upgraded our web apps from Firebase 2.X to Firebase 3.X. I hadn't had much experience with Firebase before then, so it was a good learning exercise for me.
I am relatively new to the concept of backend as a service, having always worked with a backend developer, but I'm excited to be tinkering. I, naturally, ran into a roadblock along the way.
ember build
and firebase deploy
multiple times to no availA modal popped up and I followed the instructions to copy/paste the following code snippet into my index.html:
// TODO: Replace with your project's customized code snippet
<script src="https://www.gstatic.com/firebasejs/3.0.2/firebase.js"> </script>
<script>
// Initialize Firebase
var config = {
apiKey: '<your-api-key>',
authDomain: '<your-auth-domain>',
databaseURL: '<your-database-url>',
storageBucket: '<your-storage-bucket>'
};
firebase.initializeApp(config);
</script>
Note: This approach probably only works for static websites and may not have worked for me because [single page app](https://en.wikipedia.org/wiki/Single-pageapplication). So don't do this, I guess._
ember install emberfire
in your app directory on localhostConfigure Firebase Database URL:
// config/environment.js
firebase: 'https://firebase-app-name.firebaseio.com'
firebase
property is for your database, so it has to be .firebaseio.com NOT .firebaseapp.comAdd database rules:
// database.rules.json
{
"rules": {
".read": true,
".write": true
}
}
ember build
to build to ./distfirebase init
in app directory./dist
when prompted for your public directoryfirebase use --add
and select respective appfirebase deploy
will deploy to the cloud from localMost of the steps I mentioned in this note are actually available in the following links. I just put them here, explicitly, so I could add notes to help me remember why shit worked and why shit didn't.
Will have to work towards using more Firebase features beyond just hosting.
That is all.