Search code examples
firebasehostingweb-hostingfirebase-hosting

How To Host An Image With Firebase Hosting?


Issue

How do I host an image file with Firebase hosting?

I'm currently going through the steps in Firebase In App Messaging to setup messages to show to the user within the app. When asked to provide an Image URL for the message the UI suggests using Firebase hosting. I have followed the setup instructions and have successfully hosted my first site.

I cannot find documentation regarding hosting an image resources such as a png file that can route to a specific URL.

enter image description here

Setup

Hosting Configuration

enter image description here

Hosting Success

enter image description here


Solution

  • Solution

    Under the public directory which is the default directory when initializing Firebase Hosting, simply add the image resource file such as a png.

    Once the resources are deployed you can refer to the resource in the url.

    File Structure

    enter image description here

    Url To Image

    https://your-project-name.firebaseapp.com/your-image.png