Go langのgoogleAppEngineのトライアルの手順
Go langのAppEngineのトライアルの手順
こちらにアクセス
1 NAME YOUR PROJECT
You use your project to manage all of the Google Cloud Platform resources for your app, including deployment, access control, billing, and services. You can change your project name later.
プロジェクト名を入力します。
2 SELECT YOUR LANGUAGE
Goをクリック
3 EXPLORE THE STARTER CODE
Browse the starter code and see the app running below.
ちょっと確認しながらすっ飛ばし!
4 INSTALL GOOGLE CLOUD SDK
1.Download and install Google Cloud SDK by running the following command in your shell or Terminal:
curl https://sdk.cloud.google.com/ | bash
Follow the prompts to install the Go App Engine package.
2.Edit your ~/.bashrc file (or other appropriate shell start-up file) to set an alias for the goapp command:
vim ~/.bashrc alias goapp=~/google-cloud-sdk/platform/google_appengine/goapp
3.Restart your shell or Terminal to pick up environment changes.
4.Sign in to Google Cloud Platform using this command:
gcloud auth login
5 RUN YOUR APP LOCALLY
1.Download your project starter code from the editor in "3. Explore the starter code" by clicking the Download your code button. Alternatively, you can download the Flask starter code .
2.Unpack the Zip archive to create your project directory.
3.Start a local server using this command:
goapp serve appengine-try-go
You can stop the server by pressing Ctrl-C in the command window.
4.Visit the locally running app in your browser: http://localhost:8080
6 CREATE YOUR PROJECT AND DEPLOY
Congratulations! Your project is ready. Your unique project ID is XXXXXXXX.
Deploy your app from your local dev environment using this command:
goapp deploy -oauth -application XXXXXXX appengine-try-go
After deploying your app, you can visit it with your browser at this URL:
That's it! You're running on Google App Engine. Go to your project dashboard to see how your app is performing.