dqlk31541 2018-12-05 00:42
浏览 33
已采纳

运行dev_appserver.py时,如何强制gcloud cli不监视某些目录?

I'm developing an app locally using Go and React with a project structure that looks somewhat like this:

/reactApp 
   /main.go
   /api 
   /reactUI 

While I am developing locally I am using the gcloud cli tool to run the Go code, and I'm using Node to run the UI. I need to handle CORS of course, but otherwise this works fairly well. The problem is there are too many files in the /reactUI directory for the gcloud cli tool to monitor them all. This means I need to manually start and stop the server every time I make a change to the Go source code.

The reactUI directory was created using the 'npx create-react-app' command. Since I'm running the react part of this app locally using node (and that handles file monitoring and auto-updating just fine), how can I get the gcloud tool to ignore the reactUI directory? Basically I just want the gcloud tool to monitor the API part of the app, and not the UI part. If I make a change to the API part of the app the gcloud local server should automatically recompile and restart.

I haven't found anything yet in the docs, please let me know if I missed something. Thanks!

  • 写回答

1条回答 默认 最新

  • dqce48404 2018-12-05 22:38
    关注

    With https://issuetracker.google.com/issues/35895450 fixed the development server is supposed to not monitor changes in the files/directories matching the patterns specified in the skip_files section of the app/service's .yaml file.

    So you can try to add a skip_files section to the go app's .yaml file specifying the patterns for the files/directories you want ignored. Be careful to also add the default patterns (otherwise you'd lose them).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?