【问题标题】:Hosting a Google App Engine app on my own server在我自己的服务器上托管 Google App Engine 应用
【发布时间】:2014-07-13 07:45:55
【问题描述】:

以下可能吗?

我想托管处理来自 URL 的网站图标的应用,就像 getFavicon 一样。

网站:http://g.etfv.co 来源:https://github.com/potatolondon/getfavicon

我上周已通过电子邮件向创建者询问此帖子的标题,但没有任何回复。我看到其中涉及到很多 Python,只是将文件放在我的服务器上并没有任何作用。

【问题讨论】:

  • 使用 Google App Engine,您可以在本地机器上将其作为虚拟机运行,并连接到您启动它的任何端口,使用选项 0.0.0.0 作为 ip。这便于测试,例如 Flask 应用程序。
  • @BHM 这很好,但我宁愿在我自己的服务器上运行它。你永远不知道谷歌什么时候会关闭服务,我宁愿靠自己。
  • 那么我会说答案是not possible,但想知道这个问题的意义何在?为什么要为您不信任框架提供者的框架做点什么?
  • @BHM 我没有制作应用程序,也不想使用框架。我想知道如何设置我的服务器以便它可以运行应用程序。
  • 对不起;但这不是我对SO 问题的期望。 How-to 由框架提供者提供。

标签: python google-app-engine


【解决方案1】:

我发现为 node.JS 写了类似的东西,并在此处分叉:https://github.com/IdeasNeverCease/getFavicon

编辑:此代码满足我最初的要求,即加载网站图标,无论 URL 是什么:

var getFavicon = function () {

    var favicon, _tabID = $(".tab.active").attr("data-tab");
    var nodeList = $("iframe" + _tabID).contents().find("link");

    for (var i = 0; i < nodeList.length; i++) {
        // get any type of icon
        if ((nodeList[i].getAttribute("rel") == "icon") || (nodeList[i].getAttribute("rel") == "shortcut icon") || (nodeList[i].getAttribute("rel") == "apple-touch-icon")) {
            favicon = nodeList[i].href; // get absolute path
        }
    }

    return favicon;

};

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-09-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-05
    • 1970-01-01
    • 2015-06-26
    相关资源
    最近更新 更多