我在快递中创建了一个项目
const express = require('express');
const app = express();
const PORT = 5555;
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});
app.get('/tr', (req, res, next) => {
res.json({ status: 200, data: 'tr' })
});
app.get('/po', (req, res, next) => {
res.json({ status: 200, data: 'po' })
});
module.exports = {
app
};
部署在名为my-transaction的云函数上
我正在安排 google clound 给 url 之类的
当我在没有身份验证的情况下部署时调度程序运行作业成功,但是当我进行身份验证时它失败。
如果我创建如下示例项目,则类似
exports.helloHttp = (req, res) => {
res.json({ status: 200, data: 'test hello' })
};
并部署与上面相同的配置,并使用它工作的身份验证。
唯一的区别是最后一个函数名称类似于入口点的意思,而上面的入口点是具有不同端点的应用程序。
任何帮助,不胜感激谢谢