【发布时间】:2018-06-12 01:05:48
【问题描述】:
我使用 nuxt 创建了我的应用,我想通过 Firebase 托管进行部署。
所以我编辑了我的 firebase.json
{
"hosting": {
"public": "./",
"ignore": [
"firebase.json",
"testssr.js",
"node_modules/**",
"/plugins/**",
...
],
"rewrites": [
{
"source": "**/**",
"function": "render"
}
]
}
}
并创建一个函数render
let app = express();
let config = {
dev: false
}
const nuxt = new Nuxt(config)
app.use(nuxt.render)
exports.render = functions.https.onRequest(app)
但是,它不起作用,我找不到任何错误。
当我创建一个快速应用程序时,它可以工作。
const config = {
dev: false
}
const nuxt = new Nuxt(config)
app.use(nuxt.render)
app.listen(3000, ()=>{
console.log('works')
})
【问题讨论】:
-
你解决了吗?
标签: google-cloud-functions firebase-hosting server-side-rendering nuxt.js