Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Serverless Web Applications with React and Firebase

You're reading from   Serverless Web Applications with React and Firebase Develop real-time applications for web and mobile platforms

Arrow left icon
Product type Paperback
Published in Apr 2018
Publisher Packt
ISBN-13 9781788477413
Length 284 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Harmeet Singh Harmeet Singh
Author Profile Icon Harmeet Singh
Harmeet Singh
Mayur Tanna Mayur Tanna
Author Profile Icon Mayur Tanna
Mayur Tanna
Arrow right icon
View More author details
Toc

Setting up the Cloud Storage


With Firebase SDK, we can easily integrate and set up Cloud Storage for Firebase in our application.

To set up Cloud Storage, you will need the URL of the Storage bucket, which you can get from our Firebase Console. You can get it from the Files tab of Storage menu, as illustrated:

Once you get it, you can add it to your Firebase config.

Consider this example:

import firebase from 'firebase';

const config = {
    apiKey: "AIzaSyDO1VEnd5VmWd2OWQ9NQkkkkh-ehNXcoPTy-w",
    authDomain: "demoproject-7cc0d.firebaseapp.com",
    databaseURL: "https://demoproject-7cc0d.firebaseio.com",
    projectId: "demoproject-7cc0d",
storageBucket: "gs://demoproject-7cc0d.appspot.com",
    messagingSenderId: "41428255555"
};

export const firebaseApp = firebase.initializeApp(config);

// Get a reference to the storage service,
var storage = firebase.storage();

Now we are ready to use Cloud storage. Now we need to create a reference, which can be used to navigate through the file hierarchy...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime