2017-05-17 3 views
0

アングル2とエンドポイントの「hello world」グーグルアプリはどのように見えますか?私はそれを検索しようとしましたが、ちょうど情報の抜粋を見つけることができます... like here。だから、私は角度のCLI "ng new"と "ng build --prod"を使ってdistフォルダを作成します。それから、私はGoogleエンドポイントを持っています(両方とも別々です)。しかし、どのように参加するのですか? 具体的には、私のapp.yaml "dist"と "skip_files"に、_ah/api/explorerにエラーが発生した後にGET ... descovery ... 500 - "BackendService.getApiConfigs Error"を追加します。しかし、locallhostで - "アプリが動作します!" https://cloud.google.com/endpoints/docs/frameworks/python/get-started-frameworks-pythonアングル2とGAEエンドポイントの基本アプリ

と角度アプリから自分のエンドポイントを呼び出す: `

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 

` とGoogleクラウドエンドポイントのPythonフレームワークを使用するための

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]) 

答えて

関連する問題