Javascript 在Google应用程序引擎上部署react应用程序:app.yaml路径问题

Javascript 在Google应用程序引擎上部署react应用程序:app.yaml路径问题,javascript,reactjs,google-app-engine,Javascript,Reactjs,Google App Engine,我尝试在google app engine上运行react应用程序,但app.yaml配置存在一些问题。如果url路径为,则react应用程序正在工作。但也有一些路线,如,不起作用 问题是react应用程序试图通过以下路径获取.js和.css文件: 但它必须是: 在结束/结束时,路径也不工作: 我的app.yaml: service: react-app runtime: nodejs12 handlers: - url: /static/js/(.*) static

我尝试在google app engine上运行react应用程序,但app.yaml配置存在一些问题。如果url路径为,则react应用程序正在工作。但也有一些路线,如,不起作用

问题是react应用程序试图通过以下路径获取.js和.css文件:

但它必须是:

在结束/结束时,路径也不工作:

我的app.yaml:

service: react-app
runtime: nodejs12
handlers:
  - url: /static/js/(.*)
    static_files: build/static/js/\1
    upload: build/static/js/(.*)
  - url: /static/css/(.*)
    static_files: build/static/css/\1
    upload: build/static/css/(.*)
  - url: /static/media/(.*)
    static_files: build/static/media/\1
    upload: build/static/media/(.*)
  - url: /(.*\.(json|ico))$
    static_files: build/\1
    upload: build/.*\.(json|ico)$
  - url: /
    static_files: build/index.html
    upload: build/index.html
  - url: /.*
    static_files: build/index.html
    upload: build/index.html
我的文件夹结构是:

build/
- static/
-- css/
-- js/
-- media/
- index.html
app.yaml
也许有人对我有同样的问题或解决办法。
谢谢大家!

我发现您在部署应用程序引擎应用程序时遇到了问题,即在尝试获取.js和.css文件时,应用程序正在错误路径中搜索它们

关于如何使用NodeJS为App Engine管理和提供静态文件,您可以尝试遵循文档中关于如何构造App.yaml文件以正确获取静态文件的指导原则

我还发现了一个(尽管它使用Python作为运行时)显示了类似的项目结构,以及一个关于如何构造app.yaml的示例

我认为app.yaml文件获取URL的方式可能是个问题,尽管子路径的整体处理程序结构也应该修改