Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support request: possible to deploy as cloud function? #123

Open
semla opened this issue Nov 4, 2020 · 5 comments
Open

Support request: possible to deploy as cloud function? #123

semla opened this issue Nov 4, 2020 · 5 comments

Comments

@semla
Copy link

semla commented Nov 4, 2020

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,

@chrisguttandin
Copy link
Owner

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.

@semla
Copy link
Author

semla commented Nov 5, 2020

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?

@chrisguttandin
Copy link
Owner

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?

@semla
Copy link
Author

semla commented Nov 5, 2020

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?

@chrisguttandin
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants