facebook twitter hatena line email

「Gcp/Firebase/CloudFunctions」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(firebaseログイン)
(firebaseログイン)
行13: 行13:
 
  $ firebase login
 
  $ firebase login
 
ブラウザが開くので、firebaseコンソールに繋がるgoogleアカウントでログインする。
 
ブラウザが開くので、firebaseコンソールに繋がるgoogleアカウントでログインする。
 +
 +
==functionsを新規作成==
 +
$ firebase init functions
 +
? What language would you like to use to write Cloud Functions? JavaScript
 +
? Do you want to use ESLint to catch probable bugs and enforce style? No
 +
✔  Wrote functions/package.json
 +
✔  Wrote functions/index.js
 +
✔  Wrote functions/.gitignore
 +
? Do you want to install dependencies with npm now? Yes
 +
 +
#プロジェクトを選択
 +
#JavaScriptとTypeScriptを選択、とりあえずJavaScriptを選択
 +
#ESLintはデフォルトoffだったので、offで作成
 +
#npmの依存パッケージはデフォルトyesだったので、yesで作成
  
 
==参考==
 
==参考==
 
https://devlog.hassaku.blue/2019/03/unity-firebase-firebase.html
 
https://devlog.hassaku.blue/2019/03/unity-firebase-firebase.html

2019年6月4日 (火) 02:23時点における版

CloudFunctionsとは

  • 関数処理をしてくれるもの。awsのlamdaと同じ。
  • nodeで動く

CloudFunction準備

nvmインストール

Javascript/nodejs/インストール/nvm [ショートカット]

firebaseログイン

$ npm install -g firebase-tools
$ firebase --version
6.10.0
$ firebase login

ブラウザが開くので、firebaseコンソールに繋がるgoogleアカウントでログインする。

functionsを新規作成

$ firebase init functions
? What language would you like to use to write Cloud Functions? JavaScript
? Do you want to use ESLint to catch probable bugs and enforce style? No
✔  Wrote functions/package.json
✔  Wrote functions/index.js
✔  Wrote functions/.gitignore
? Do you want to install dependencies with npm now? Yes
  1. プロジェクトを選択
  2. JavaScriptとTypeScriptを選択、とりあえずJavaScriptを選択
  3. ESLintはデフォルトoffだったので、offで作成
  4. npmの依存パッケージはデフォルトyesだったので、yesで作成

参考

https://devlog.hassaku.blue/2019/03/unity-firebase-firebase.html