Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 角度2和GAE端点上的基本应用程序_Angular_Google App Engine_Google Cloud Endpoints - Fatal编程技术网

Angular 角度2和GAE端点上的基本应用程序

Angular 角度2和GAE端点上的基本应用程序,angular,google-app-engine,google-cloud-endpoints,Angular,Google App Engine,Google Cloud Endpoints,使用angular 2和endpoint时,“hello world”谷歌应用程序的外观应该如何?我试着搜索过,但只能找到信息的摘录。因此,我使用angular CLI“ng new”和“ng build--prod”创建dist文件夹。然后我有了google端点(两个端点是分开工作的)。但它是如何加入的呢? 在我的具体案例中,我在app.yaml中添加了“dist”和“skip_files”,之后_ah/api/explorer有错误获取…描述。。。500-“BackendService.ge

使用angular 2和endpoint时,“hello world”谷歌应用程序的外观应该如何?我试着搜索过,但只能找到信息的摘录。因此,我使用angular CLI“ng new”和“ng build--prod”创建dist文件夹。然后我有了google端点(两个端点是分开工作的)。但它是如何加入的呢? 在我的具体案例中,我在app.yaml中添加了“dist”和“skip_files”,之后_ah/api/explorer有错误获取…描述。。。500-“BackendService.getApiConfigs错误”。但在LocalHost上——“应用程序工作!” `

` 及


要使用Google Cloud Endpoints Python框架,请参阅教程:

要从Angular应用程序调用端点,请使用GAPI:

application: graphgroop
version: 1
runtime: python27
threadsafe: true
api_version: 1

handlers:
- url: /(.+)
  static_files: dist/\1
  upload: dist/(.*)
  secure: always
- url: /
  static_files: dist/index.html
  upload: dist/index.html
  secure: always
- url: /.*
  script: endp.app
  secure: always
- url: /_ah/spi/.*
  script: GG.app
  secure: always
# Temporary setting to keep gcloud from uploading not required files for deployment
skip_files:
- ^node_modules$
- ^app\.yaml
- ^README\..*
- \.gitignore
- ^\.git$
- ^grunt\.js
- ^src$
- ^e2e$
- \.editorconfig
- ^karma\.config\.js
- ^package\.json
- ^protractor\.conf\.js
- ^tslint\.json

libraries:
- name: endpoints
  version: 1.0

- name: pycrypto
  version: latest

inbound_services:
- mail

builtins:
- remote_api: on
import endpoints
from protorpc import messages
from protorpc import message_types
from protorpc import remote
from google.appengine.ext import ndb

JS_CLIENT_ID = '6**********************.googleusercontent.com'

class Answer(messages.Message):
    ans = messages.StringField(1)

class Base(ndb.Expando):
    name = ndb.StringProperty()

@endpoints.api(name='sss', version='v1', allowed_client_ids=[
endpoints.API_EXPLORER_CLIENT_ID,
JS_CLIENT_ID
],
scopes=[endpoints.EMAIL_SCOPE])
class Try(remote.Service):
    @endpoints.method(Answer,
                      Answer,
                      path='answer',
                      http_method='PUT',
                      name='answer')
    def answer(self, message):
        entity = Base(name=message.ans)
        entity.put()
        return Answer(ans='Sucses: ' + message.ans )


app = endpoints.api_server([Try])