简体   繁体   English

如何在 GAE 上部署 angular9

[英]How to deploy angular9 on GAE

I followed this tutorial step by step.我一步一步地遵循了这个教程 Only get this:只得到这个: 在此处输入图像描述

Here is my app.yml这是我的app.yml

runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /
  static_files: dist/fe/index.html
  upload: dist/fe/index.html
- url: /
  static_dir: dist/fe

skip_files:
  - e2e/
  - node_modules/
  - src/
  - ^(.*/)?\..*$
  - ^(.*/)?.*\.json$
  - ^(.*/)?.*\.md$
  - ^(.*/)?.*\.yaml$
  - ^LICENSE

I have no idea why it happens.我不知道为什么会这样。 The angular app runs on the default 4200 port. angular 应用程序在默认的 4200 端口上运行。 Is it the cause?是原因吗?

TL;DR: You need to run npm isntall and ng run commands before deploying the project to GAE. TL;DR:在将项目部署到 GAE 之前,您需要运行npm isntallng run命令。

I also followed the tutorial that you mentioned and got the same result.我还按照您提到的教程进行了操作,并得到了相同的结果。 Upon inspecting the GAE logs I was able to see that 404 errors were taking place, and their messages were Static file referenced by handler not found: dist/pounds-to-kg/index.html在检查 GAE 日志时,我发现发生了 404 个错误,它们的消息是Static file referenced by handler not found: dist/pounds-to-kg/index.html

The ng run command builds the project and creates the dist/ folder that stores all the artifacts ng run命令构建项目并创建存储所有工件的dist/文件夹

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM