简体   繁体   English

节点模块在Firebase托管中不起作用?

[英]Node module doesn't work in Firebase hosting?

I have a Node server and use Firebase hosting. 我有一个节点服务器,并使用Firebase托管。 The server uses the Node module rss-to-json for parsing a RSS feed to JSON. 服务器使用Node模块rss-to-json将RSS feed解析为JSON。

When I test the server on my machine, the request works, but when deploying it doesn't work. 当我在机器上测试服务器时,该请求有效,但是在部署时不起作用。 It just loads forever and gives: 它会永远加载并给出:

"Error 503 first byte timeout" “错误503第一个字节超时”

My code: 我的代码:

const functions = require("firebase-functions");
const express = require("express");
const Feed = require("rss-to-json");

app.get("/feed", (req, res) => {
    Feed.load("https://www.reddit.com/.rss", function(err, rss) {
        res.send(rss);
    });
});

exports.app = functions.https.onRequest(app);

Have tried: 试过:

Removed "node_modules" from "ignore" in firebase.json, but no luck. 从firebase.json中的“忽略”中删除了“ node_modules”,但是没有运气。

Any ideas? 有任何想法吗?

On the Spark payment plan, you can't make outgoing requests to services that aren't fully controlled by Google. 在Spark付款计划中,您无法向不受Google完全控制的服务发出传出请求。 If you want to do this, you'll have to upgrade your project to the Blaze plan. 如果要执行此操作,则必须将项目升级到Blaze计划。 See the pricing page for more information. 有关更多信息,请参见定价页面

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM