goapp serve : not working, 'goapp' is not

2019-06-12 15:55发布

问题:

Cloud any help me,

I am trying to setup local development server from below link

https://cloud.google.com/appengine/docs/standard/go/tools/using-local-server

I am getting below errors while using goapp serve command

Error:

'goapp' is not recognized as an internal or external command, operable program or batch file.

回答1:

Assuming you've installed the Google Cloud SDK and then you installed the Go appengine with gcloud components install app-engine-go as instructed in this link.

If you read through the instructions you'll find this paragraph:

Cloud SDK excludes the appcfg and goapp commands. To continue using those commands, see the steps for downloading and installing the original App Engine SDK.

That means that if you want to use goapp serve you need to install the original App Engine SDK for Go. Steps for installing it can be found at the bottom of the same page by clicking on the highlighted text "Or, you can download the original App Engine SDK for Go."


But to run your app locally or eventually deploying to Google Cloud you don't need the original SDK. Having gcloud installed you also get the dev_appserver.py command, you can use this command instead of goapp serve to run a local development server like so: dev_appserver.py /path/to/myapp/app.yml.

Keep in mind that:

dev_appserver.py does not run in the App Engine flexible environment.