Open nitedani opened 2 months ago
Agreed. Although I'd name it headersResponse
(because of pageContext.headers
and https://github.com/vikejs/vike/issues/1268).
How much of a priority is it?
(I think) related to this I'd like to be able to set a cookie from a +data.ts file.
@gnardini Indeed with useConfig()
it would be a nice addition.
In the meantime, how about the following?
// +data.js
export default (pageContext) => {
pageContext.theCookieIWantToadd = '...'
}
Then access it at your renderPage()
integration.
Description
I'd like the ability to set response headers in a hook/config.
This would be useful for, for example https://github.com/magne4000/vite-plugin-vercel, so it could allow users to set cache-control headers in their +config.js file, to leverage Vercels edge cache.
I think headers could be a vike core config, for example: