【发布时间】:2020-12-05 04:58:41
【问题描述】:
我正在为我的 slack 机器人使用 node js 和 yarn。它在本地工作正常,但我不知道如何在 firebase 上部署它以让我的机器人工作。 这是我的 index.js:
const functions = require('firebase-functions');
require = require("esm")(module/*, options */);
module.exports = require("./app.js");
但要将其部署在 firebase 上,我需要类似我的 index.js 的东西:
const app = express();
exports.widgets = functions.https.onRequest(app);
但我没有使用 express()。那么我该怎么做呢?附言我所有的机器人逻辑都在 app.js 中,这就是为什么我 require("./app.js");
【问题讨论】:
-
这里没有足够的信息来了解您需要做什么。我建议查看 HTTP 触发器的文档以了解如何编写和部署函数。如果您不使用 express,则必须学习其他替代方法。 firebase.google.com/docs/functions/http-events
标签: javascript node.js firebase google-cloud-functions firebase-hosting