0

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')
})
1
  • Did you solve this? Commented Jan 7, 2018 at 5:51

1 Answer 1

2

It looks like you have to terminate a http function with one of the following:

response.send()
response.redirect()
response.end()

https://firebase.google.com/docs/functions/http-events#terminate_http_functions

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.