2018年2月25日 星期日

serverless gcp (google cloud functioin)

參考這個。
開新的 project
要下載keyjson 註明在 serverless.yaml裡

sls deploy 
service: serverless-85332

provider:
name: google
runtime: nodejs
project: serverless-85332 //這裡要註意,要和你的project名稱一樣
# the path to the credentials file needs to be absolute
credentials: ~/.gcloud/keyfile.json
後記:
bug:
因為想查 google cloud functions 有沒有台灣,所以下載 gcloud,但是不知道為何,目錄權限得一直自已開啟。


functions:
line_notify_cpc:
handler: handler.line_notify // handler 的命名,gcp不允許的樣子
events:
- http:
method: get
path: line_notify_cpc

沒有留言:

張貼留言