首页 文章

使用App Engine SDK在localhost中部署我的Google endpoints python应用程序时出错

提问于
浏览
6

我使用谷歌 Cloud endpoints 配置

https://cloud.google.com/appengine/docs/python/endpoints/test_deploy

确切地说,我用旗帜运行谷歌铬

--user-data-dir=temp --unsafely-treat-insecure-origin-as-secure=http://localhost:8080

https://developers.google.com/explorer-help/#hitting_local_api

然后,谷歌Chrome说我

您正在使用不受支持的命令行(--unsafely-treat-insecure-origin-as-secure)标志 . 稳定性和安全性将受到影响

如果我访问

_http://本地主机:8080 / _ah / API /探险

然后我得到错误:

您正在探索的API是通过HTTP托管的,这可能会导致问题 . 了解如何将Explorer与本地HTTP API配合使用 .

我尝试添加 --test-type 标志为

_http://stackoverflow.com/questions/32042187/chrome-error-you-are-using-an-unsupported-command-line-flag-ignore-certifcat

然后谷歌铬不说什么,但当我访问

_http://本地主机:8080 / _ah / API /探险

我犯了同样的错误 .

我的应用程序在localhost中工作正常,除了 endpoints 部分,并且所有工作在appspot.com上都很好( endpoints 也是如此)

我用的是最后一个版本:

  • Python 2.7.11

  • App Engine SDK 1.9.35

  • 谷歌浏览器49.0.2623.110

谢谢你,对不起我的英语

3 回答

  • 0
    • 点击Chrome网址栏中的盾牌按钮 .

    Chrome Google Cloud Endpoints API Explorer: load scripts

    • 单击"Load unsafe scripts" .

    • 单击服务(在左侧栏中)以重新加载页面 .

  • 1

    当我第一次开始发生这个问题时,我尝试对此问题进行排查 . 我很快就放弃了,决定在localhost上使用另一个浏览器来访问API资源管理器 . IE 11适合我 . 这不是一个好的答案,但如果您安装了其他浏览器,请尝试一下 .

  • 5

    虽然Alex有最好的答案,但我想指出这只是API Explorer的一个问题(绝对可以方便) .

    但它不会影响对API本身的直接调用 . 因此,无需打开特殊的沙箱铬应用程序或更改脚本设置,下面的URL工作正常

    localhost:8080/_ah/api/greeting/v1/greetings/1
    

相关问题