-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(gatsby): use pathPrefix for SSR/DSG page-data requests with gatsby serve
#36231
Conversation
e134160
to
01a61c9
Compare
handler(request, response, { | ||
public: path.resolve(`assets`), | ||
headers: [ | ||
{ | ||
source: `**/*`, | ||
headers: [ | ||
{ | ||
key: `Access-Control-Allow-Origin`, | ||
value: `*`, | ||
}, | ||
], | ||
}, | ||
], | ||
}) | ||
proxy.web(request, response, { target: "http://localhost:9000" }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
used proxy here instead of separate serve because of "on-demand" behaviour of DSG/SSR which would need to be either replicated here (or just forward request to serve to let it handle it)
app.get( | ||
router.get( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actual fix - router strips path prefix and enables engines to find proper pages
Description
Start with failing test and SSR page to
path-prefix
e2e tests and couple of assertions, will be followed by a fix to make it greenRelated Issues
Fixes #35406