在Firebase云功能中运行人偶代码 [英] running puppeteer code in firebase cloud functions

查看:61
本文介绍了在Firebase云功能中运行人偶代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一个个人项目,该项目是一个应用程序,用户可以在该应用程序中输入其地址&信用卡信息,然后单击按钮以购买我经常访问的其中一所大学的停车许可证.

I'm working on a personal project which is an app where a user can input their address & credit card info and click a button to buy a parking permit for one of the universities that I visit often.

我想将前端托管在Firebase的云存储中,并且想要创建一个云功能,在其中可以使用伪造者的代码和保存到Firebase实时数据库中的信息来运行伪造的代码.

I want to host my front end in firebase's cloud storage and I want to create a cloud function where puppeteer code can run with the information that I save to the firebase's realtime database.

Firebase云功能是否可以运行购买停车许可证的伪造者代码?

Is it possible for a firebase cloud function to run the puppeteer code that buys a parking permit?

由于木偶戏不能与云功能一起使用,我可以使用Heroku来承载木偶戏代码吗?

Since puppeteer doesn't work with cloud functions, can I use Heroku to host the puppeteer code?

推荐答案

当前无法将Puppeteer与Cloud Functions node 6运行时一起使用,因为运行已部署代码的服务器实例缺少共享Puppeteer所需的库.您可以在此GitHub问题中了解有关此内容的信息.另请参见此问题.

It's currently not possible to use Puppeteer with the Cloud Functions node 6 runtime because the server instances that run deployed code are lacking a shared library that's required by Puppeteer. You can read about that in this GitHub issue. Also see this issue.

node 8运行时版本开始,提供了puppeteer所需的库.

As of the node 8 runtime release, the required libraries for puppeteer are available.

这篇关于在Firebase云功能中运行人偶代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆