3

I am building a site that is using Angular 4, Firebase, and Firebase Cloud Functions. What I am looking to do is when certain data is added to the database I want to add, remove, or update something in an RSS feed, sitemap, and JSON feed which are files hosted with Firebase Hosting.

Any suggestions on how to accomplish this or an alternative if it is not possible without manual updates and redeploys of the project?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807

1 Answers1

4

There is currently no way to publish a new (or update a) file to Firebase Hosting based on a database (or other dynamic) trigger.

What is possible is to map a Cloud Function to a path on your site (e.g. /sitemap or /feed), generate the HTML in that Cloud Function, and then set caching headers on the result.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Thank you, that is what I was looking for. – Matt Geiser Jul 05 '17 at 20:09
  • Is it still not possible, now that it is 2022? This S.O. question is the only search result I've found for this, and it's from 2017. – simplegamer Jun 26 '22 at 00:41
  • See https://stackoverflow.com/questions/30677351/upload-single-file-to-firebase-hosting-via-cli-or-other-without-deleting-existin for an option, although that seems to not be working right now due to a change in the APIs. – Frank van Puffelen Jun 26 '22 at 01:39