現在、angular-CLIで生成されたprojection4を使用してプロジェクト構造を作成しています。これをng-serveを使用して提供し、変更を確認しました。今私は自分のバックエンドでホストされているgoogleアプリエンジンとwebApp2を使ってdev_appserver.py app.yamlを使って実行したいと思っています。現在、私が動作させる唯一の方法は、ng-buildを行い、distフォルダからファイルを提供することです。私は簡単に変更を加えることができますが、毎回それを再構築するのを待つ必要はありません。GoogleアプリケーションエンジンのAngular4とWebApp2
0
A
答えて
1
あなたはpython rest serviceと別の環境をプロダクションに向けるために、環境に角度を付けることができます。
例:
enviroment.ts
export const environment = { production: false, urlServices: 'http://190.52.112.41:8075' };
enviroment.prod.tsこのように
export const environment = { production: true, urlServices: 'http://localhost:8080' };
、あなたはので、あなたaplicationをテストするためにコンパイルする必要がいけません角は常にあなたにPythonアプリを指し示されます。
0
標準App Engineの設定を使用してapp.yamlを解決:私はこれより良い操作を行うことができる方法上の任意のフィードバックを探してい
service: stage
runtime: python27
api_version: 1
threadsafe: true
skip_files:
- ^(?!dist) # Skip any files not in the dist folder
handlers:
# Routing for bundles to serve directly
- url: /((?:inline|main|polyfills|styles|vendor)\.[a-z0-9]+\.bundle\.js)
secure: always
redirect_http_response_code: 301
static_files: dist/\1
upload: dist/.*
# Routing for a prod styles.bundle.css to serve directly
- url: /(styles\.[a-z0-9]+\.bundle\.css)
secure: always
redirect_http_response_code: 301
static_files: dist/\1
upload: dist/.*
# Routing for typedoc, assets and favicon.ico to serve directly
- url: /((?:assets|docs)/.*|favicon\.ico)
secure: always
redirect_http_response_code: 301
static_files: dist/\1
upload: dist/.*
# Any other requests are routed to index.html for angular to handle so we don't need hash URLs
- url: /.*
secure: always
redirect_http_response_code: 301
static_files: dist/index.html
upload: dist/index\.html
http_headers:
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Frame-Options: DENY
。
関連する問題
- 1. Webapp2 Googleアプリケーションエンジンのルートが機能しない
- 2. webapp2 - フォームデータの投稿方法 - アプリケーションエンジン
- 3. Googleアプリケーションエンジンとアプリスケール
- 4. java.lang.NoClassDefFoundError googleアプリケーションエンジンとメイヴェン
- 5. GoogleアプリケーションエンジンのGoogleクラウドエンドポイント
- 6. Googleアプリケーションエンジンのタスクキューとユーザーサービス
- 7. googleアプリケーションエンジンのビデオサイト
- 8. Googleアプリケーションエンジン - androidエミュレータと接続
- 9. Google App Engine + Python WebApp2のローカルユニットテスト
- 10. Googleのアプリケーションエンジンのmemcache
- 11. googleアプリケーションエンジンpythonログレベルノイズリダクション
- 12. googleアプリケーションエンジンoauth2プロバイダ
- 13. インポートエラーpycrypto googleアプリケーションエンジン
- 14. Mongodb python googleアプリケーションエンジン
- 15. Googleアプリケーションエンジン:クエリ
- 16. JPA for Googleアプリケーションエンジン
- 17. Googleアプリケーションエンジンpython rot13
- 18. Googleアプリケーションエンジンのyamlハンドラー
- 19. Googleアプリケーションエンジンのdjangoアップロードファイルエラー
- 20. Googleアプリケーションエンジンのインストールjava
- 21. Googleアプリケーションエンジンのみデータベースストア
- 22. googleアプリケーションエンジンのCUPP(ペンテスト)
- 23. Webapp2 Google App Engine Firebaseインポートエラー
- 24. Googleアプリケーションエンジンのパスとエンティティグループの関係
- 25. Googleアプリケーションエンジンのself.response.writeとself.response.out.writeの違い
- 26. イメージexifデータgoogleアプリケーションエンジン
- 27. GoogleアプリケーションエンジンでDjangoフォームプレビュー
- 28. GoogleアプリケーションエンジンHTTPエラー500
- 29. 自動リダイレクトgoogleアプリケーションエンジン
- 30. GoogleアプリケーションエンジンDTO to JDO
私はこれを試しましたが、私のファイルはアップロードされていません –
申し訳ありませんが、私はAngularもGoogle Cloud Platformも使用していません。 2つの提案:アップロードする前にdistファイルをビルドしていることを確認し( 'ng build --prod && gcloud app deploy')、' skip_files: 'セクションを削除してすべてがアップロードされるようにしてください。 – Rob