我正在寻找关于如何firebase-tools在我的角度6.0项目上正确设置托管的教程,我发现的总是这样.
- firebase init
- then select the Hosting
- What do you want to use as your public directory? dist
- Configure as a single-page app (rewrite all urls to /index.html)? Yes
- Overwrite? No
- ng build --prod
- firebase deploy
Run Code Online (Sandbox Code Playgroud)
但在这之后,这总是我所拥有的.
我尝试部署firebase函数,但由于ESLint的某些问题,它一直在失败.我也试过谷歌搜索答案,但我看到的一切都是希腊语给我.
// // Create and Deploy Your First Cloud Functions
// // https://firebase.google.com/docs/functions/write-firebase-functions
//
// exports.helloWorld = functions.https.onRequest((request, response) => {
// response.send("Hello from Firebase!");
// });
//import firebase functions modules
const functions = require("firebase-functions");
//import admin module
const admin = require("firebase-admin");
admin.initializeApp(functions.config().firebase);
// Listens for new messages added to messages/:pushId
exports.pushNotification = functions.database.ref("/Message").onWrite( event => {
// Grab the current value of what was written to the Realtime Database.
var valueObject = event.data.val(); …Run Code Online (Sandbox Code Playgroud) 我正在关注此Firebase简介教程:
https://codelabs.developers.google.com/codelabs/firebase-web/
我按照说明操作,当我到达第3步时,我跑了firebase use --add,我得到以下内容:
# firebase use --add
> web-start@1.0.0 firebase ~/repos/friendlychat/web-start
> firebase "use"
No project is currently active.
Run firebase use --add to define a new project alias.
Run Code Online (Sandbox Code Playgroud)
但如果我跑,firebase list我看到这个:
??????????????????????????????????????????????????????
? Name ? Project ID / Instance ? Permissions ?
??????????????????????????????????????????????????????
? FriendlyChat ? friendlychat-x3sd0 ? Owner ?
??????????????????????????????????????????????????????
Run Code Online (Sandbox Code Playgroud)
所以我清楚地正确登录,因为我可以列出我的项目并在CLI上对它们进行某种访问.但错误是否意味着它不活跃?我该如何激活它?教程中没有关于此的内容.
我在这里错过了什么?看起来很明显,我只是没有看到.