-
I have a site that will be statically generated and I see that the headers can be read with I used this code and I did manage to get the headers to show up in the network tab but this feels a bit too verbose, is there a better way to do this? export default defineNuxtPlugin(nuxtApp => {
if (process.server) {
console.log(nuxtApp.ssrContext.event.node.res.setHeader('Accept-CH', 'Viewport-Width'))
}
}) |
Beta Was this translation helpful? Give feedback.
Answered by
dbzx10299
May 10, 2024
Replies: 2 comments
-
I would love it if we could set headers, like this, in Nuxt Config. |
Beta Was this translation helpful? Give feedback.
0 replies
-
You can now with route rules export default defineNuxtConfig({
routeRules: {
'/**': {
headers: {
'Accept-CH': 'Width, Viewport-Width'
}
}
}
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
dbzx10299
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can now with route rules