2

我正在使用 dev_appserver.py 在本地运行 web 应用程序我的应用程序在 localhost:8080 上正常运行当我尝试访问 Api 端点资源管理器 @ localhost:8080/_ah/api/explorer 时,我收到 404 错误

控制台日志:

INFO 2017-11-07 05:59:24,864 module.py:821] default: "GET /_ah/api/explorer HTTP/1.1" 404 154

应用程序.yaml

application: hari-mq-endpoints
version: 1
runtime: python27
api_version: 1
threadsafe: yes

builtins: 
 - deferred: on

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

# Serving static files (css, images, etc)
- url: /static
  static_dir: static

# Loads some data
- url: /importdata/.*
  script: main.app
  login: admin

# Endpoints Handler
- url: /_ah/spi/.*
  script: api.app

# Main handler
- url: .*
  script: main.app

libraries:
- name: webapp2
  version: "2.5.2"
- name: jinja2
  version: "2.6"

api.py

import endpoints
from protorpc import remote
from models import MovieQuote

@endpoints.api(name="moviequotes", version="v1", description="Movie Quotes API")
class MovieQuotesApi(remote.Service):
    @MovieQuote.method(path="moviequote/insert",name="moviequote.insert", http_method="POST")
    def moviequote_insert(self, request):
        """ Inserts a new MovieQuote into the Datastore. """
        request.put()
    return request

app = endpoints.api_server([MovieQuotesApi], restricted=False)

https://developers.google.com/apis-explorer/?base=http://localhost:8080/_ah/api#p/

打开 api 资源管理器,我启用了运行不安全的脚本。但它仍然没有显示我的api

4

0 回答 0