我尝试使用端点部署一个gae项目,但是它给了我应该发生的错误。
我不认为我的代码有任何问题,但在尝试部署时我一直收到此错误:
There is a /_ah/spi handler configured, but no Google Cloud Endpoints service was found in the app
我的app.yaml:
application: app-id
version: 1
runtime: python27
api_version: 1
threadsafe: true
# --- Handlers
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: .*
script: main.app
secure: always
- url: /js
static_dir: static/js
- url: /img
static_dir: static/img
- url: /css
static_dir: static/bootstrap/css
- url: /fonts
static_dir: static/fonts
- url: /partials
static_dir: static/partials
- url: /_ah/spi/.*
script: game.api
secure: always
# --- Libraries
libraries:
- name: webapp2
version: "2.5.2"
- name: pycrypto
version: latest
- name: endpoints
version: latest
- name: jinja2
version: latest
和我的game.py:
from datetime import datetime
import endpoints
from protorpc import messages
from protorpc import message_types
from protorpc import remote
from google.appengine.api import memcache
from google.appengine.api import taskqueue
from google.appengine.ext import ndb
# --- Setup Code
WEB_CLIENT_ID = 'app-id'
# --- Classes
class Hello(messages.Message):
"""String that stores a message."""
greeting = messages.StringField(1)
class TestOne(messages.Message):
''' TestOne message '''
msg = messages.StringField(1)
# --- API & Endpoints
@endpoints.api(name='whoamigame', version='v1')
class WhoAmIGameApi(remote.Service):
@endpoints.method(message_types.VoidMessage, TestOne, path='testone', http_method='GET', name='testonemethod')
def testOneM(self, req):
testOneMsgReturn = TestOne(msg='Test One...')
return testOneMsgReturn
# --- API
api = endpoints.api_server([WhoAmIGameApi])
每次尝试部署它时,端点都会失败。我不确定如何解决这个问题。代码和语法对我来说是完美的。一切都是定义的。 sdk每次都失败了。