I created my app with nuxt, and I want to deploy by Firebase hosting.
So I edit my firebase.json
{
"hosting": {
"public": "./",
"ignore": [
"firebase.json",
"testssr.js",
"node_modules/**",
"/plugins/**",
...
],
"rewrites": [
{
"source": "**/**",
"function": "render"
}
]
}
}
And create a function render
let app = express();
let config = {
dev: false
}
const nuxt = new Nuxt(config)
app.use(nuxt.render)
exports.render = functions.https.onRequest(app)
But, it doesn't work and I can't find any error.
When I create an express app, it works.
const config = {
dev: false
}
const nuxt = new Nuxt(config)
app.use(nuxt.render)
app.listen(3000, ()=>{
console.log('works')
})