Google App Engineや他のGoogleサービス(クラウドプラットフォーム)の開発は非常に新しいので、別々のモジュールでアプリを作成したいと思います。独自のライフサイクル)を提供します。同じアプリの異なるモジュールでGoogleエンドポイントを使用する
リクエストを適切なモジュールにルーティングする方法がわからないため、私はapiのパスに苦労しています。
私のディレクトリツリーは、そのようなものです:
/myApp
/module1
__init__.py
main.py
/module2
__init__.py
main.py
module1.yaml
module2.yaml
dispatch.yaml
module1.yaml
application: myapp
runtime: python27
threadsafe: true
module: module1
version: 0
api_version: 1
handlers:
# The endpoints handler must be mapped to /_ah/spi.
# Apps send requests to /_ah/api, but the endpoints service handles mapping
# those requests to /_ah/spi.
- url: /_ah/spi/.*
script: module1.main.api
libraries:
- name: pycrypto
version: 2.6
- name: endpoints
version: 1.0
module2.yaml
application: myapp
runtime: python27
threadsafe: true
module: module2
version: 0
api_version: 1
handlers:
# The endpoints handler must be mapped to /_ah/spi.
# Apps send requests to /_ah/api, but the endpoints service handles mapping
# those requests to /_ah/spi.
- url: /_ah/spi/.*
script: module2.main.api
libraries:
- name: pycrypto
version: 2.6
- name: endpoints
version: 1.0
dispatch.yaml
dispatch:
- url: "*/_ah/spi/*"
module: module1
- url: "*/_ah/spi/.*"
module: module2
だから私はどこかに対応するモジュールの名前( '_ah/api/module1'または 'module1/_ah/api')で呼び出されるエンドポイントをしたいと思います。私は、さまざまな.yamlファイルに何を入れるべきかわかりません。私がやっていることが正しいのか、それとも可能なのか分からない。
ご回答ありがとうございます。
ありがとうございました。私は今、新しい問題に苦しんでいます。ここでは、http://stackoverflow.com/questions/37183193/unable-to-get-google-endpoints-working-over-multiple-servicesを説明していますので、解決済みとしてこれを設定します。 – ValLeNain
実際には、 dは.yamlファイルの見た目が好きです。特にアプリケーションがdevサーバーとクラウドの両方で動作するために。 – ValLeNain