我创建了Firebase Cloud Functions应用程序,我创建了函数https.onRequest.并获取数据,req.body但那里没有数据.
Firebase云功能可以处理HTTP POST方法吗?
这是我的示例代码: -
var functions = require('firebase-functions');
exports.testPost = functions.https.onRequest((req, res) => {
console.log(req.body);
});
Run Code Online (Sandbox Code Playgroud)
我使用POST方法测试邮递员,但没有在Firebase日志中显示结果.
我的 Chrome Packaged App 有 2 个 JavaScript 文件。
1. background.js 是一个由 manifest.json 调用的主要 JavaScript 文件
var foo = 'sss';
function bar(a,b) {
return a+b;
}
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('index.html', {
bounds: {
width: 500,
height: 300
}
});
});
Run Code Online (Sandbox Code Playgroud)
2. app.js 是 index.html 的控制器
问题:我可以在app.js 中从background.js调用变量“foo”或函数“bar”吗?
附注。或者有什么解决方案可以在页面之间传输价值,例如chrome.storage?