angular-prerender
angular-prerender copied to clipboard
Support request: possible to deploy as cloud function?
I am looking to deploy a cloud function that can prerender a few urls. I am looking into different ways, but very new to Universal and ssr. Would it be possible to use this library as a cloud function? Thanks,
Hi @semla, I think it depends on your use case.
Do you need that cloud function to prerender a few URLs when deploying your app? In that case the answer is yes. Anything that runs Node.js can be used to run angular-prerender.
Do you want to render some URLs on demand (when a user actually requests on of the URLs) then this sounds more like a use case for Angular Universal with a caching layer to me.
I hope this helps.
Hi @chrisguttandin, definitely helps. It is more the first use-case, so not in response to requests. I am a bit lost on how to set up angular-prerender as a cloudfunction, any pointers?
I think it's common to use a CI system like Travis, Circle CI, or GitHub Actions for that task. Would that work for your use case?
Don't think so, I want to render a few urls every half hour or so. So not when deploying, rather when the data fetched has been updated. So not in response to user request either, more like a chron-job. See what I mean? I guess the CI/CD systems use npm to run this library?
Yes, exactly. It would be just another npm script. I'm not sure about other services but GitHub Actions can for example also be triggered like a cron job.