Sr ,I'm having the same error. And your link github is 404. How do you solve this issue? Tks.
Found the index.js he was talking about
github.com/KiritchoukC/kiritchoukc...
const functions = require('firebase-functions') const { Nuxt } = require('nuxt') const express = require('express') const contact = require('./contact')
const app = express() app.use(express.json())
const config = { /**
const nuxt = new Nuxt(config)
let isReady = false const readyPromise = nuxt .ready() .then(() => { isReady = true }) .catch(() => { process.exit(1) })
async function handleRequest(req, res) { if (!isReady) { await readyPromise } res.set('Cache-Control', 'public, max-age=1, s-maxage=1') await nuxt.render(req, res) }
app.post('/api/contact', contact) app.get('*', handleRequest) app.use(handleRequest) exports.nuxtssr = functions.https.onRequest(app)
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Sr ,I'm having the same error. And your link github is 404. How do you solve this issue? Tks.
Found the index.js he was talking about
github.com/KiritchoukC/kiritchoukc...
const functions = require('firebase-functions')
const { Nuxt } = require('nuxt')
const express = require('express')
const contact = require('./contact')
const app = express()
app.use(express.json())
const config = {
/**
const nuxt = new Nuxt(config)
let isReady = false
const readyPromise = nuxt
.ready()
.then(() => {
isReady = true
})
.catch(() => {
process.exit(1)
})
async function handleRequest(req, res) {
if (!isReady) {
await readyPromise
}
res.set('Cache-Control', 'public, max-age=1, s-maxage=1')
await nuxt.render(req, res)
}
app.post('/api/contact', contact)
app.get('*', handleRequest)
app.use(handleRequest)
exports.nuxtssr = functions.https.onRequest(app)