Gcp/Firebase/Hosting
提供: 初心者エンジニアの簡易メモ
2019年6月11日 (火) 15:34時点におけるAdmin (トーク | 投稿記録)による版 (→Must select at least one feature. Use SPACEBAR to select features, or provide a feature with firebase init [feature_name]エラー)
$ npm install -g firebase-tools $ firebase login $ firebase init $ firebase deploy
hostingを選択してspaceを押す
Must select at least one feature. Use SPACEBAR to select features, or provide a feature with firebase init [feature_name]エラー
spaceを押して選択する
httpアクセス
ttps://xxxx-xxxxxx.firebaseapp.com/
public/index.html がそのまま公開される
firebaseのfunctionsと連携
vi firebase.json
{
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [ {
"source": "/helloWorld", "function": "helloWorld"
} ]
}
}
ttps://xxxx-xxxxxx.firebaseapp.com/helloWorld にアクセスすると、 functionsのhelloWorldメソッドにアクセスできる
