Closed learntheropes closed 2 years ago
I've the following code:
vercel.json
"config": { "internalServer": true, "serverFiles": [ "middleware/**.js" ] }
nuxt.config.js
serverMiddleware: ['~/middleware/response-header.js']
middleware/response-header.js
export default (req, res, next) => { res.setHeader("x-foo", "bar") res.setHeader("Cache-Control", "s-maxage=86400 stale-while-revalidate=2678000") next() }
The response headers are applied when testing locally but not when deployed on vercel.
What can be the issue?
I've the following code:
vercel.json
nuxt.config.js
middleware/response-header.js
The response headers are applied when testing locally but not when deployed on vercel.
What can be the issue?