Skip to content

Instantly share code, notes, and snippets.

@nazo
Last active November 25, 2018 03:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nazo/6001f5231a748e432c5a6a05a4027fc1 to your computer and use it in GitHub Desktop.
Save nazo/6001f5231a748e432c5a6a05a4027fc1 to your computer and use it in GitHub Desktop.
GAE Go

無料枠

https://cloud.google.com/free/?hl=ja

  • GAE 1インスタンス(?)
  • Datastore
  • Storage

1.11

https://cloud.google.com/appengine/docs/standard/go111/

app.yaml

runtime: go111

handlers:
- url: /.*
  script: _go_app
  • 1.11では http.ListenAndServe でもサーバーの起動ができるけどApp Engine APIを使う時はdev_appserver.pyが必要

ローカルでAPIを叩く

  • ConsoleのAPIダッシュボードでAPIを有効化する
    • Storageを使うには Cloud Storage JSON API が必要
  • 「サービスアカウント」から適切な権限を設定したものを作成し、JSON形式で鍵をダウンロード
  • GOOGLE_APPLICATION_CREDENTIALS 環境変数にJSONファイルへのパスを指定する。

Storage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment