firebase-functions:托管给出错误:时间去构建非凡的东西

时间:2018-03-15 12:41:27

标签: node.js firebase google-cloud-functions firebase-cli

我可以通过仅托管工作正常部署文件 但我尝试使用firebase函数,它说:

Welcome
Firebase Hosting Setup Complete
You're seeing this because you've successfully setup Firebase Hosting. Now it's time to go build something extraordinary!

OPEN HOSTING DOCUMENTATION

我的index.js代码在这里: -

const functions = require('firebase-functions');

    // // 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!");
     });

链接到我的项目: -

https://influence-cbc3f.firebaseapp.com/

2 个答案:

答案 0 :(得分:2)

如果要部署功能,请使用以下命令:

firebase deploy --only functions

更多信息:

https://firebase.google.com/docs/functions/get-started

答案 1 :(得分:0)

如果您使用的是Angular 6,请在以下步骤中提供“ dist ”:

  

?您想用作公共目录的什么

您将需要提供“ dist /您的应用名称

查看这篇出色的文章 https://medium.com/@longboardcreator/deploying-angular-6-applications-to-firebase-hosting-b5dacde9c772