小编Hyu*_*Kim的帖子

AppEngine Google Cloud Endpoint - 未找到发现

我是Python和Google AppEngine的新手,但有大约7年的编程经验.我也是StackOverflow的新手.

我一直在尝试为我的个人项目设置一个简单的Google Cloud Endpoint API,并已完成并将完成的应用程序上传到Google App Engine.

以下是我的Endpoint API设置:

@endpoints.api(name='puzzle', version='v1', description='Puzzle Engine API')
Run Code Online (Sandbox Code Playgroud)

和方法:

@endpoints.method(
        PuzzleMessage, PuzzleMessage,
        name='puzzle.generate',
        http_method='GET',
        path='generate'
    )

@endpoints.method(
        PuzzleMessage, PuzzleMessage,
        name='puzzle.solve',
        http_method='GET',
        path='solve'
    )
Run Code Online (Sandbox Code Playgroud)

我的app.yaml看起来像:

handlers:
- url: /favicon\.ico
  static_files: favicon.ico
  upload: favicon\.ico

- url: .*
  script: main.app

# Endpoints handler
- url: /_ah/api/.*
  script: services.application

libraries:
- name: webapp2
  version: "2.5.2"
Run Code Online (Sandbox Code Playgroud)

最后,services.py读取:

from google.appengine.ext import endpoints
from api import puzzle_api

application = endpoints.api_server([
                               puzzle_api.PuzzleAPI
                           ], restricted=False)
Run Code Online (Sandbox Code Playgroud)

现在,问题是,当我尝试访问https:// my-app-name .appspot.com/_ah/api/discovery/v1/apis时,我看到的只是

未找到

此外,当我点击https://developers.google.com/apis-explorer/?base=https:// my-app-name …

python google-app-engine google-cloud-endpoints

4
推荐指数
1
解决办法
4903
查看次数