Firebase hosting issues

我的未来我决定 提交于 2019-12-11 10:51:07

问题


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/**"
  ]
}

回答1:


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.



来源:https://stackoverflow.com/questions/32026032/firebase-hosting-issues

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!