如何在Google Firebase托管服务中使用Node.js? [英] How to use nodejs in google firebase hosting service?

查看:94
本文介绍了如何在Google Firebase托管服务中使用Node.js?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个nodejs应用程序,但是当我尝试使用Google托管Firebase创建一个应用程序时,我只能修改index.html文件,但不能将index.js文件用作nodejs应用程序. br> 我不知道该怎么办.
这是firebase.json文件:

I want to create a nodejs app, but when I tried to create an app with google's hosting firebase I only can modify an index.html file, but I can't use a index.js file as a nodejs app.
I don't know how to do with this.
Here is the firebase.json file:

{
  "database":{"rules":"database.rules.json"},
  "hosting":
  {
    "public":"public",
    "rewrites": 
    [{
      "source":"**",
      "destination":"/index.html"
    }]
  }
}

但是我无法修改该文件以执行nodejs应用.有帮助吗?

But I can't modify that file for executing a nodejs app. Any help?

推荐答案

更新:现在可以通过与2017年5月启动的Cloud Functions集成在Firebase Hosting中托管Node.js应用程序.有关更多信息,请参见将云功能连接到Firebase托管文档.

UPDATE: It is now possible to host Node.js apps in Firebase Hosting through an integration with Cloud Functions launched in May of 2017. See Connecting Cloud Functions to Firebase Hosting docs for more information.

这篇关于如何在Google Firebase托管服务中使用Node.js?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆