【发布时间】:2020-05-25 01:16:16
【问题描述】:
我有一个使用 HTTPS 服务的 React 应用程序(我需要它用于在后台运行的服务人员) 我的后端使用 Firebase Functions 在本地运行时出现 CORS 问题。
Firebase Functions 只是封装了一个启用了 CORS 模块的 express 应用程序。 我使用 OPTIONS 调用这个后端执行了一些测试,我得到了正确的标头。
他们的问题是我的前端 (HTTPS) 无法访问我的后端 (HTTP)。 有没有办法使用 HTTPS 而不是 HTTP 在本地运行 firebase 函数?
运行firebase serve --help 只显示
Options:
-p, --port <port> the port on which to listen (default: 5000) (default: 5000)
-o, --host <host> the host on which to listen (default: localhost) (default: "localhost")
--only <targets> only serve specified targets (valid targets are: hosting, functions, database, firestore)
--except <targets> serve all except specified targets (valid targets are: hosting, functions)
-h, --help output usage information
【问题讨论】:
标签: node.js firebase express google-cloud-functions firebase-cli