Firebase托管问题 [英] Firebase hosting issues

查看:71
本文介绍了Firebase托管问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Express-Jade文件的基本Node js应用程序.我想将其部署到我的Firebase A/C上.当我使用firebase deploy命令时,我不断得到:

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

说实话,我没有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.

这是我的fiebase.json文件的样子:

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

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

推荐答案

Firebase托管是托管静态资产的服务,例如静态网站.静态网站的根目录通常是firebase deploy命令检查的index.html页面.

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 (来自我对该主题的快速研究")是一个节点模板引擎.这意味着它在node.js进程内运行.运行Firebase托管的CDN服务器不会向您的站点公开node.js API.

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.

因此,您不能直接在Firebase Hosting上运行Jade模板支持的网站. Jade命令行工具具有将Jade模板转换为常规HTML的命令(例如$ jade < my.jade > my.html ),然后可以将其部署到Firebase Hosting.

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.

这篇关于Firebase托管问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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