Google Cloud Platform
Functions
babel 関係のセットアップ
{
"main": "dist/index.js",
"scripts": {
"build": "babel src --out-dir dist --ignore **/__tests__/**",
"deploy": "yarn build && gcloud beta functions deploy helloGET --trigger-http",
"deploy:local": "yarn build && functions deploy helloGET --trigger-http"
}
}
コマンド
ファイル
// src/index.js
exports.helloGET = (req, res) => {
res.send('Hello World!');
};
デプロイ
# web
gcloud beta functions deploy helloGET --trigger-http
# local
functions deploy helloGET --trigger-http
説明
gcloud beta functions describe helloGET