How to use nodejs in google firebase hosting service?

I want to create a nodejs application, but when I tried to create an application with googlehost firebase, I can only change the index.html file, but I cannot use the file index.jsas a nodejs application. <sh> I do not know how to do this.
Here is the file firebase.json:

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

But I can not modify this file to run the nodejs application. Any help?

+10
source share
3 answers

: Node.js Firebase Hosting , 2017 . . Firebase Hosting.

+20

Firebase node.js. , . - , Firebase. xervo . xervo.io

xervo.io ,

0

FYI >>

Firebase js , js ,

https://firebase.google.com/docs/hosting/functions   -

and we need to create an object for the application and export it as follows and replace firebase.json as follows

var app = express (); exports.app = functions.https.onRequest (app);

firebase.json:

Overwrites: [{"source": "**", "Destination": "application"}]

0
source

Source: https://habr.com/ru/post/1016020/


All Articles