You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In current Sapper it's easy to intercept requests and do whatever you want with them since you're building a server — this is useful for auth, custom headers and so on. The Sapper middleware also has a session property that populates the session store when a request is made that falls within Sapper's purview.
In a serverless-first world this gets a bit trickier. It needs to be possible to do both things, in a way that maps to the various serverless platforms out there, which most likely precludes using the (req, res) => {...} signature (and by extension, the ecosystem of Express middleware).
Maybe this is a new src/request.js file (naming subject to extensive bikeshedding):
It probably doesn't make sense to intercept all requests (since in many cases the responses get baked out as flat files), so we probably have to work within the constraint of only intercepting requests for pages and server routes.
The text was updated successfully, but these errors were encountered:
In current Sapper it's easy to intercept requests and do whatever you want with them since you're building a server — this is useful for auth, custom headers and so on. The Sapper middleware also has a
session
property that populates the session store when a request is made that falls within Sapper's purview.In a serverless-first world this gets a bit trickier. It needs to be possible to do both things, in a way that maps to the various serverless platforms out there, which most likely precludes using the
(req, res) => {...}
signature (and by extension, the ecosystem of Express middleware).Maybe this is a new
src/request.js
file (naming subject to extensive bikeshedding):It probably doesn't make sense to intercept all requests (since in many cases the responses get baked out as flat files), so we probably have to work within the constraint of only intercepting requests for pages and server routes.
The text was updated successfully, but these errors were encountered: