【发布时间】:2018-03-04 18:13:30
【问题描述】:
我有一个简单的 firebase 函数,它必须发送一个文件以响应文件在 /app/one.html 中的请求
我的项目目录结构
blog
|____app
|____index.html
|____one.html
|____functions
|____index.js
我必须访问 one.html 并从 senFile() 发送它
index.js
const functions = require('firebase-functions');
exports.blog = functions.https.onRequest((req, res) => {
res.status(200).sendFile('app/one.html'); #here I need something to do
});
【问题讨论】:
-
如果你想发送
one.html替换index.html。 -
好的,不管它是什么文件,都应该被访问。 @kgangadhar
标签: node.js firebase firebase-hosting