google-app-engine - 无法访问本地主机上的 API 资源管理器

标签 google-app-engine google-cloud-endpoints

我正在尝试构建 Endpoints 应用程序,但我是 Google App Engine 的新手。

据我所知,SDK 中包含某种 API Explorer,可以让我测试/验证我的 API —— 文档说:“通过导航到 http,在 Google APIs Explorer 中测试 API 后端://localhost:8080/_ah/api/explorer”。但是我找不到任何关于 API Explorer 实际是什么、做什么或看起来像什么的文档。

无论如何,当我尝试点击那个 URL 时,我会立即被重定向到 https://developers.google.com/apis-explorer/?base=http://localhost:8080/_ah/api#p/ ,它没有告诉我任何有用的信息,看起来一定是某种错误。

devappserver 日志说:

INFO     2013-07-17 17:27:54,574 server.py:593] default: "GET /_ah/api/explorer HTTP/1.1" 302 -
INFO     2013-07-17 17:27:56,099 server.py:593] default: "GET /_ah/api/static/proxy.html?jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en.7JUwNUXMAS8.O%2Fm%3D__features__%2Fam%3DEQ%2Frt%3Dj%2Fd%3D1%2Frs%3DAItRSTO0dpKS_pssf5r3z87E6FlFvDGdOg HTTP/1.1" 200 1933
INFO     2013-07-17 17:27:56,193 server.py:593] default: "POST /_ah/spi/BackendService.getApiConfigs HTTP/1.1" 200 2342
INFO     2013-07-17 17:27:56,492 server.py:593] default: "GET /_ah/api/discovery/v1/apis HTTP/1.1" 200 576
INFO     2013-07-17 17:27:56,507 server.py:593] default: "POST /_ah/spi/BackendService.getApiConfigs HTTP/1.1" 200 2342
INFO     2013-07-17 17:27:56,583 server.py:593] default: "POST /_ah/spi/BackendService.getApiConfigs HTTP/1.1" 200 2342
INFO     2013-07-17 17:27:56,811 server.py:593] default: "GET /_ah/api/discovery/v1/apis HTTP/1.1" 200 576
INFO     2013-07-17 17:27:56,886 server.py:593] default: "GET /_ah/api/discovery/v1/apis/scrnxSync/v1/rest HTTP/1.1" 200 3365

不管有什么值(value)。

这是我的 app.yaml:

application: scrnx-cloud-1
version: 1
runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /admin/.*
  script: admin.application
  login: admin
  secure: always

  # Endpoints handler
- url: /_ah/spi/.*
  script: sync_api.application

  # catchall - must come last    
- url: /.*
  script: default.application


admin_console:
  pages:
  - name: View Measurement
    url: /admin/measurement  


libraries:
- name: jinja2
  version: 2.6
- name: markupsafe
  version: 0.15

builtins:
- admin_redirect: off
- appstats: off
- deferred: off
- remote_api: on

我还应该做些什么来设置它吗?

最佳答案

有些事情发生了变化,现在您必须以特定方式启动 Chrome 才能在本地主机开发服务器上使用 api explorer

这是一个link从谷歌获取信息。

但对我来说,使用 api explorer 和 localhost dev server 仍然没有解决问题。
我发现一个可能的解决方法是使用标志“--allow-running-insecure-content”启动 Chrome
在终端中的 MacOs 上运行这个:

/Applications/Google\ Chrome.app/Contents/Mac/Google\ Chrome --user-data-dir=test --allow-running-insecure-content

关于google-app-engine - 无法访问本地主机上的 API 资源管理器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17706437/

相关文章:

google-app-engine - 谷歌云存储性能和全文搜索

java - 无类 已注册云端点

google-cloud-endpoints - 通过 Google Cloud Endpoints 公开 Swagger-UI 文档

java - Google App Engine 不支持 vision api Runtime.addShutdownHook 错误

python - 如何将通过 Django 上传的 CSV 文件存储到 Google App Engine 上的 blobstore 中?

java - GAE 和 GWT - 使用 Maven 而不是 Eclipse 的 Google 插件

python - 数据存储中现有实体的复合索引写入

javascript - 重定向到不同的域 URL(Google 应用程序引擎注销)在 silverlight + javascript 中不起作用

authentication - 使用 Google Cloud Endpoints 保护 Google Cloud Run 上的内部 API 的最佳方式

android - Java POJO 类和无 sql 数据存储