You will need the following things properly installed on your computer.
git clone
cd library-app
npm install
ember serve
- Visit your app at http://localhost:4200.
ember test
ember test --server
ember build
(development)ember build --prod
(production)
Firebase is a server and API service. Very easy to use. http://firebase.google.com
- Create an account.
- You can read the latest Readme on EmberFire website: https://github.com/firebase/emberfire (You can find the earlier version’s guide and help section here: https://www.firebase.com/docs/web/libraries/ember/guide.html)
- First, run the following command in your terminal:
ember install emberfire
- You will see instructions in the console. We have to manually add a few lines to our configuration file. Copy and paste those lines in config/environment.js. (Please note you may have to update a few single quotes to double-quotes in contentSecurityPolicy, check my code snippet below, double-quotes are corrected there.)
- Go back to Firebase and create an app there. When your new firebase database ready, click on the purple icon on Overview page (“Add Firebase to your web app”). Check those params in the popup window (“apiKey”, “authDomain”, etc.) and copy-paste the values in your config/environment.js file in your Ember application accordingly.
// config/environment.js
module.exports = function(environment) {
var ENV = {
modulePrefix: 'library-app',
environment: environment,
baseURL: '/',
locationType: 'auto',
firebase: {
apiKey: 'xyz',
authDomain: 'YOUR-FIREBASE-APP.firebaseapp.com',
databaseURL: 'https://YOUR-FIREBASE-APP.firebaseio.com',
storageBucket: 'YOUR-FIREBASE-APP.appspot.com',
messagingSenderId: '1234'
},
// if using ember-cli-content-security-policy
contentSecurityPolicy: {
'script-src': "'self' 'unsafe-eval' apis.google.com",
'frame-src': "'self' https://*.firebaseapp.com",
'connect-src': "'self' wss://*.firebaseio.com https://*.googleapis.com"
},
EmberENV: {
FEATURES: { ...
npm install -g firebase-tools
ember build --prod
firebase login
firebase init
And deploy:
firebase deploy
firebase open
Select Hosting: Deployed Site