Sagar
Sagar

Reputation: 229

Firebase hosting issues

I have a basic node js app using express-jade files. I wanted to deploy it onto my firebase a/c. When I use firebase deploy command, I keep getting :

Preparing to deploy Public Directory...
Public Directory Warning - Public directory does not contain an index.html

And honestly, I don't have an index.html file coz I am using jade files. I am a newbie in client side related items so any help would be appreciated.

Here's how my fiebase.json file looks like:

{
  "firebase": "torrid-heat-237",
  "public": "./findUrTalentsAdmin-master",
  "ignore": [
    "firebase.json",
    "**/.*",
    "**/node_modules/**"
  ]
}

Upvotes: 1

Views: 1635

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 598668

Firebase Hosting is a service for hosting static assets, e.g. a static web site. The root of a static web site is normally an index.html page, which the firebase deploy command checks for.

Jade (from my quick "research" on the topic) is a node template engine. This means that it runs inside a node.js process. The CDN servers that Firebase Hosting runs on, do not expose a node.js API to your site.

So you cannot run a Jade template powered web site directly on Firebase Hosting. The Jade command line tool has commands to convert your Jade templates into regular HTML (e.g. $ jade < my.jade > my.html), which you can then deploy to Firebase Hosting.

Upvotes: 1

Related Questions