Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Cloud Functions access Firebase Hosting files

Tags:

I am trying to create a SEO friendly Angular (4) application. This application is built using Firebase (+ AngularFire2). But the current problem I am having is that I can not access the ngfactory that is necessary for an Angular Universal app (I believe).

So my question was, is it possible for Firebase Cloud Functions to access the Firebase Hosting files. I believe that would allow me to access that ngfactory file I need to generate the html for my SEO.

Is this possible?

like image 520
Stan van Heumen Avatar asked Jun 02 '17 03:06

Stan van Heumen


1 Answers

Cloud Functions can access any file available via an HTTP request. So, if your ngfactory file has a URL, you can certainly download it and use it within a function.

You can also deploy any file along with your functions by simply placing it in your functions directory. And you can then read that file locally during a function's invocation.

like image 136
Doug Stevenson Avatar answered Oct 11 '22 14:10

Doug Stevenson